Logging into one instance of JIRA logs me out of a second instance

Dave Donnelly [Sensata]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

I have two instances of JIRA running on the same server. All seems to be functioning well with the one exception that users logged into JIRA1 and then logging into JIRA2 will be logged out of JIRA 1 and vice versa.

Any way to stop getting logged out of one JIRA instance when logging into a second?

6 answers

1 accepted

2 votes
Answer accepted
Jo-Anne MacLeod
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

The answers and comments seem to go all over the place, so I'm posting a new answer that will hopefully clear things up.

What you need to do is set the 'context' path to point to a different directory, on one of your instances.

edit the server.xml and modify the line:

<Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">

to be

<Context path="temp" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">

(The only thing that I changed is the addition of a directory in the 'path' variable)

You will then need to restart your JIRA instance.

Everything should work properly now. You can also use this same fix if you are having problem with a confluence instance running on the same server

1 vote
Jo-Anne MacLeod
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

It is a problem with the cookies being over written. You will need to change your context path and that should resolve the issue.

Section 5 in the attached page, http://confluence.atlassian.com/x/eAISCw

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

You've installed it with two different ports I guess, both running on / ?

I've never used the windows installer but try looking for server.xml. After changing the context root you will need to change the base URL for the instance too (admin -> general config).

Dave Donnelly [Sensata]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

Thanks Jo-Anne,

however, I'm using the windows standalone installer and a search for "jira.xml" on my server turns up nothing...?

Jo-Anne MacLeod
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

change the "context" on your server.xml. Oh, and you only need to make this change on one of them. If you are running two different instances of JIRA each one will have a separate server.xml file.

Dave Donnelly [Sensata]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

Ignore the {code} tags it seems. Confluence user fail... ;)

Dave Donnelly [Sensata]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

Yes I've one instance running on localhost:8080 and the other on localhost:8085.

The server.xml for the port 8080 instance looks like this:

{code}<Context docBase="${catalina.home}/atlassian-jira" path="" reloadable="false" useHttpOnly="true">{code}

If I can leave that one as is then all well and good.

I'm looking at the server.sml file for the port 8085 instance and I see:

{code} <Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">{code}

What should I change this to?

Thanks a million for the help,

Dave

Jo-Anne MacLeod
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

sorry, I should have been more clear. In one of your server.xml files change the context line to be something similar to the following

<context path="jira2" docbase...blah, blah blah

where jira2 is the name of a directory

0 votes
Simon Leclercq March 27, 2013

i found the reason why this was not working after changing the context. the url of Jira will be changed when you change the context... it will become whatever you had before + /temp at the end of it

Chuck Minarik January 22, 2014

If I put <Context path="/dev" docbase=... where is the dev folder supposed to be located?

0 votes
Simon Leclercq March 27, 2013

i have changed the path in the server.xml but when i restart the Jira service, I cannot connect to it anymore.

If i remove what i put in the path and restart the service, Jira is working fine.

here is what I put :

<Context path="/temp" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

My guess is that the two cookies in play here are overwriting the ones for the other instance.

If you use a debugging proxy, eg Fiddler, you can check the cookie path for the JSESSIONID. For an instance running with no context root, it should be something like:

Set-Cookie: JSESSIONID=3879A8C3288B5677DFA0B999B23364D6; Path=/; HttpOnly
Set-Cookie: seraph.rememberme.cookie=12210%3A9af3eb5b02a6a924e78ba8c3a9d1e423b5924d57; Expires=Tue, 25-Oct-2011 15:15:35 GMT; Path=/; HttpOnly

Note the Path=/. For your instances, you should see Path=/InstanceA or whatever.
Can you check that? If that's the problem, have you set up the context roots in server.xml, or have you done it some other way, eg with Apache somehow?

Dave Donnelly [Sensata]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

@Jamie

waaaaay outa my league there. I didn't modify the server.xml files at all. Is there something I should have edited in there at all...?

0 votes
Zicong Xiu October 10, 2011

this may not be the problem of JIRA, but the problem with you web browser. Please try to use different browsers to log into different JIRA instance. i.e, use firefox to log into one instance, and use ie to log into another.

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

that would work, it's not really a solution though.

Dave Donnelly [Sensata]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2011

Yes using two different web browsers works, although as Jamie states: not a workable solution.

Suggest an answer

Log in or Sign up to answer