how to Pass the JSESSIONID cookie in the headers o...
# ask-stanley-ai
r
how to Pass the JSESSIONID cookie in the headers of the request running in the same session?
c
AI generated answer (using internal Slack threads):
To pass the JSESSIONID cookie in the headers of the request running in the same session, you can follow these steps: 1. From the user interface, you can get the JSESSIONID by creating a formula field with the formula
{nlsessionid}
. 2. Use the value from the field to set the cookie on the headers of a request. Here is an example of how you can set the cookie in the headers:
Copy code
javascript
var headers = {};
headers['Cookie'] = 'JSESSIONID=' + nlobjField.getId('nlsessionid');
3. If you are doing this from webservices, you can get a valid JSESSIONID from the login operation. 4. You can set that JSESSIONID on a field to use in your user event, or skip the user event and just directly make a request to the suitelet. Please note that manipulating the JSESSIONID is not generally recommended. If possible, consider using the script file of the suitelet as a library for your user event. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811755657
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.78116703
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.7795766
Please provide your feedback on this answer.