We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How can we pass JSESSIONID in ServiceNow REST API Message?

Ajay Sharma2
Kilo Sage

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

Maik Skoddow
Tera Patron

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