How can we pass JSESSIONID in ServiceNow REST API Message?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 03:49 AM
I am using POST REST API and every time I execute this API, new JSESSIONID is being generated is there a way I can utilise the static JSESSIONID for all executions.
I have tried with setRequestHeader like: k.setRequestHeader("Cookie",cookievalue) but no luck.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 04:52 AM
the solution is described at https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0657578
Maik

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 05:36 AM
Hi @Maik Skoddow ,
I have tried using this but this wasn't helpful. If I write :
var cookies = putCallResponse.getCookies();
gs.log("cookiesafter>>>>" + cookies);
The log doesn't show JSESSIONID in the cookies
Regards,
Ajay