Description
Creates a session and its associated data, generating a sessionKey.
Parameters
Name | Type | Description |
---|---|---|
data | Object, optional | A JSON object containing the data you'd like to store in the session. Default {} |
platform | String, required | Either "CF", "ICM", "JAVA", "DOTNET" or "APISERVER" |
platformVersion | String, optional | An optional version number |
Example Request
function(params, credentials) {
let result = this.callWorkerMethod('sitesessionstore', 'createSession', {
"platform": "APISERVER",
"platformVersion": "1",
"data": {
"message": "hello",
"moreData": {
"example": "tadah"
}
}
});
return result;
}
Response
Name | Type | Description |
---|---|---|
created | String, ISO datetime | The create time of the session |
platform | String | The platform set in the request |
platformVersion | String | The platform version set in the request |
sessionKey | String | The session key with the update count appended |
updateCount | Integer | New sessions have a count of 0 |
updated | String, ISO datetime | When the session was last updated. Matches the created time on create |
Example Response
{
"id": 81,
"result": {
"updateCount": 0,
"sessionKey": "5cb4d890-2ea6-4deb-a09d-5ad8f78a2964_0",
"created": "2023-08-01T13:05:54Z",
"platformVersion": "1",
"updated": "2023-08-01T13:05:54Z",
"platform": "APISERVER"
},
"jsonrpc": "2.0"
}
Platform and Version
The
The
Both properties are provided to segregate different session types and to make it easier for you to detect or invalidate sessions that may not be compatible with an updated release of your code.