How to get the cookie, on clicking any transition button

Muhammad Ali November 13, 2017

i want to get the cookie from the browser, when i click on the transition button on view issue page.

Actually i want to perfrom the cookie base authentication.

Once i'll get the cookie then i would be able to pass it to the rest api for cookie base authentication.

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 12, 2017

Hi Muhammad,

We have steps on how to generate the cookie from your login session over on JIRA REST API Example - Cookie-based Authentication.

But if I understand your request, you want to be able to obtain the cookie via your browser session, say when a transition occurs.   This cookie is actually getting generated when you login it Jira, and not necessarily when this transition happens. 

But you might be able to use something like the developer Tools in the Chrome browser to obtain the JSESSIONID in order to do this.   I took a look at my browser to see what this looks like in the developer tools after an issue transition:

browsercookie1.png

But you can notice here that on that line of the JSESSIONID, the expiration is set to 'Session' rather than a specific date.   These cookies always have some value for when they expire, but with a session timeout set, as soon as this session is over that cookie would expire.  It isn't clear to me if you could actually use that cookie for a REST API authentication as such.  Instead I would still recommend following the steps in JIRA REST API Example - Cookie-based Authentication if you want to use cookie based authentication.

Regards,

Andy

Suggest an answer

Log in or Sign up to answer