Updates session configurations while the session is in the Active state, such as lifecycle parameters (e.g., SessionTTLInSeconds and SessionIdleTimeoutInSeconds). After the update takes effect, LastModifiedTime is automatically refreshed. These updates can be used to extend or shorten the validity period of a session and enable dynamic management without changing the execution environment bound to the session.
Debugging
Authorization information
Request syntax
PUT /2023-03-30/functions/{functionName}/sessions/{sessionId} HTTP/1.1
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| functionName | string | No | The name of the function to which the session belongs. | my-func |
| sessionId | string | No | The ID of the session to be updated. | test-sessionid-1 |
| qualifier | string | No | The function alias or version associated with the session to be updated. | aliasName1 |
| body | UpdateSessionInput | No | The session update configuration. |
Response parameters
Examples
Sample success responses
JSONformat
{
"sessionId": "81f70ae156904eb9b7d43e12f511fe58",
"functionName": "functionName1",
"sessionAffinityType": "HEADER_FIELD",
"sessionTTLInSeconds": 21600,
"sessionIdleTimeoutInSeconds": 1800,
"createdTime": "2025-04-01T08:15:27Z",
"lastModifiedTime": "2025-04-01T18:15:27Z",
"sessionStatus": "Active",
"containerId": "c-68999e02-16a1955c-d2a03d1ccs",
"qualifier": "AliasName1",
"nasConfig": {
"groupId": 100,
"mountPoints": [
{
"enableTLS": true,
"mountDir": "/home/test",
"serverAddr": "***-uni85.cn-hangzhou.nas.com:/"
}
],
"userId": 100
}
}Error codes
For a list of error codes, visit the Service error codes.
