Delete Session ID

DELETE /node/api/users/session

Deletes a session ID.

Request parameters

Header parameters

Parameter

Type

Description

Cookie

string

required

A session ID previously generated using the Create Session ID method.

Response description

...

Examples

Request examples

Bash
JavaScript
NodeJS
Python
Bash
saymon_hostname=<...>
url=https://$saymon_hostname/node/api/users/session
curl -X DELETE $url --cookie cookies.txt
JavaScript
let sessionId = <...>
let saymonHostname = <...>
let path = "/node/api/users/session";
let headers = new Headers();
headers.append("Cookie", "sid=" + sessionId);
let requestOptions = {
method: "DELETE",
headers: headers
};
fetch(saymonHostname + path, requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log("error", error));
NodeJS
const http = require("http");
let sessionId = <...>
let saymonHostname = <...>
let path = "/node/api/users/session";
let options = {
"method": "DELETE",
"hostname": saymonHostname,
"headers": {
"Cookie": "sid=" + sessionId
},
"path": path
};
let req = http.request(options, function (res) {
let chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
let body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
Python
import requests
session_id = <...>
saymon_hostname = <...>
url = "https://" + saymon_hostname + "/node/api/users/session"
headers={"Cookie": "sid=" + session_id}
response = requests.request("DELETE", url, headers=headers)
print(response.text)