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

The response body is empty.

Examples

Bash
JavaScript
NodeJS
Python
1
session_id=<...>
2
saymon_hostname=<...>
3
url=https://$saymon_hostname/node/api/users/session
4
5
curl -X DELETE $url -H "Cookie: sid=$session_id"
Copied!
1
let sessionId = <...>
2
let saymonHostname = <...>
3
let path = "/node/api/users/session";
4
5
let headers = new Headers();
6
headers.append("Cookie", "sid=" + sessionId);
7
8
let requestOptions = {
9
method: "DELETE",
10
headers: headers
11
};
12
13
fetch(saymonHostname + path, requestOptions)
14
.then(response => response.text())
15
.then(result => console.log(result))
16
.catch(error => console.log("error", error));
Copied!
1
const http = require("http");
2
3
let sessionId = <...>
4
let saymonHostname = <...>
5
let path = "/node/api/users/session";
6
7
let options = {
8
"method": "DELETE",
9
"hostname": saymonHostname,
10
"headers": {
11
"Cookie": "sid=" + sessionId
12
},
13
"path": path
14
};
15
16
let req = http.request(options, function (res) {
17
let chunks = [];
18
19
res.on("data", function (chunk) {
20
chunks.push(chunk);
21
});
22
23
res.on("end", function (chunk) {
24
let body = Buffer.concat(chunks);
25
console.log(body.toString());
26
});
27
28
res.on("error", function (error) {
29
console.error(error);
30
});
31
});
32
33
req.end();
Copied!
1
import requests
2
3
session_id = <...>
4
saymon_hostname = <...>
5
url = "https://" + saymon_hostname + "/node/api/users/session"
6
headers={"Cookie": "sid=" + session_id}
7
8
response = requests.request("DELETE", url, headers=headers)
9
print(response.text)
Copied!
Last modified 1yr ago