Verify Session ID

GET /node/api/users/session/verify/:sid

Verifies whether the provided session ID is valid.

Request parameters

Path parameters

Parameter
Type
Description
sid
String
required
The session ID to be verified. It is also possible to provide session ID in Cookies: sid=$sid or X-Session-Id: $sid headers instead.

Response description

The response body contains true if the session ID is valid and null if not.

Examples

Bash
JavaScript
NodeJS
Python
1
login=<...>
2
password=<...>
3
session_id=<...>
4
saymon_hostname=<...>
5
url=http://$saymon_hostname/node/api/users/session/verify/$session_id
6
7
curl -X GET $url -u $login:$password
Copied!
1
let login = <...>
2
let password = <...>
3
let saymonHostname = <...>
4
let sessionID = <...>
5
let path = "/node/api/users/session/verify/"
6
let auth = "Basic " + btoa(login + ":" + password)
7
8
let myHeaders = new Headers();
9
myHeaders.append("Authorization", auth);
10
11
let requestOptions = {
12
method: 'GET',
13
headers: myHeaders,
14
redirect: 'follow'
15
};
16
17
fetch(saymonHostname + path + sessionID, requestOptions)
18
.then(response => response.text())
19
.then(result => console.log(result))
20
.catch(error => console.log('error', error));
Copied!
1
let http = require('follow-redirects').http;
2
let fs = require('fs');
3
let saymonHostname = <...>;
4
let login = <...>;
5
let password = <...>;
6
let sessionID = <...>;
7
let auth = 'Basic ' + Buffer.from(login + ':' + password).toString('base64');
8
9
let options = {
10
'method': 'GET',
11
'hostname': saymonHostname,
12
'path': '/node/api/users/session/verify/' + sessionID,
13
'headers': {
14
'Authorization': auth
15
},
16
'maxRedirects': 20
17
};
18
19
let req = http.request(options, function (res) {
20
let chunks = [];
21
22
res.on("data", function (chunk) {
23
chunks.push(chunk);
24
});
25
26
res.on("end", function (chunk) {
27
let body = Buffer.concat(chunks);
28
console.log(body.toString());
29
});
30
31
res.on("error", function (error) {
32
console.error(error);
33
});
34
});
35
36
req.end();
Copied!
1
import requests
2
3
login = <...>
4
password = <...>
5
saymon_hostname = <...>
6
session_id = <...>
7
8
url = "http://" + saymon_hostname + "/node/api/users/session/verify/" + session_id
9
10
response = requests.request("GET", url, auth=(login, password))
11
12
print(response.text)
Copied!
Last modified 6mo ago