Session problems with two BaseX installations

Wednesday, 22 May 2024 · 4 messages · last reply 27 May 2024
JS
Jack Steyn22 May 2024 05:44 #
Hi, I have two separate BaseX installations on the same machine. Each has its own set of databases and users. I run their HTTP servers simultaneously, configured to their own sets of ports. When I authenticate to the DBA webapp of one, I am logged out of the DBA webapp of the other. What might I do to prevent this? Best regards, Jack
CG
Christian Grün22 May 2024 12:47 #
Hi Jack, It seems that the browser ignores different ports when handling session data (just a guess). Does it work if you change the session key of your second DBA instance [1]? Best, Christian [1] https://github.com/BaseXdb/basex/blob/df83d80238a27f3a168e3d5e88f984c819a37fb8/basex-api/src/main/webapp/dba/lib/config.xqm#L8-L9
Quoted text · Jack Steyn · 16 lines
On Wed, May 22, 2024 at 5:44 AM Jack Steyn <steynjack at gmail.com> wrote: > Hi, > > I have two separate BaseX installations on the same machine. Each has its > own set of databases and users. I run their HTTP servers simultaneously, > configured to their own sets of ports. > > When I authenticate to the DBA webapp of one, I am logged out of the DBA > webapp of the other. > > What might I do to prevent this? > > Best regards, > > Jack >
JS
Jack Steyn22 May 2024 16:10 #
Hi Christian, I think you're right, this is a browser issue relating to ports being ignored. Unfortunately changing the session key doesn't resolve the issue. It sounds like the DBA webapps need to be contacting different hosts to prevent session data from being overwritten. Do you have any advice on how to go about accomplishing this? I'm afraid networking is not one of my strengths. Many thanks for your assistance. Best, Jack
Quoted text · Christian Grün · 33 lines
On Wed, 22 May 2024, 8:47 pm Christian Grün, <christian.gruen at gmail.com> wrote: > Hi Jack, > > It seems that the browser ignores different ports when handling session > data (just a guess). Does it work if you change the session key of your > second DBA instance [1]? > > Best, > Christian > > [1] > https://github.com/BaseXdb/basex/blob/df83d80238a27f3a168e3d5e88f984c819a37fb8/basex-api/src/main/webapp/dba/lib/config.xqm#L8-L9 > > > On Wed, May 22, 2024 at 5:44 AM Jack Steyn <steynjack at gmail.com> wrote: > >> Hi, >> >> I have two separate BaseX installations on the same machine. Each has its >> own set of databases and users. I run their HTTP servers simultaneously, >> configured to their own sets of ports. >> >> When I authenticate to the DBA webapp of one, I am logged out of the DBA >> webapp of the other. >> >> What might I do to prevent this? >> >> Best regards, >> >> Jack >> >
CG
Christian Grün27 May 2024 12:35 #
Hi Jack, I’m no servlet expert either, but it seems you can change the default name (JSESSIONID) of the session cookie in your web.xml file to something else. For example:
<session-config>
    <cookie-config>
        <name>MYBELOVEDAPP</name>
    </cookie-config>
</session-config>
If you open the Development → Application → Cookies panel of your browser, you should be able to see if your custom session key was adopted. If that works, there should be no need anymore to change the DBA session key, as suggested in my previous reply. Hope this helps, Christian
Quoted text · Jack Steyn · 50 lines
On Wed, May 22, 2024 at 4:10 PM Jack Steyn <steynjack at gmail.com> wrote: > Hi Christian, > > I think you're right, this is a browser issue relating to ports being > ignored. Unfortunately changing the session key doesn't resolve the issue. > It sounds like the DBA webapps need to be contacting different hosts to > prevent session data from being overwritten. Do you have any advice on how > to go about accomplishing this? I'm afraid networking is not one of my > strengths. > > Many thanks for your assistance. > > Best, > > Jack > > On Wed, 22 May 2024, 8:47 pm Christian Grün, <christian.gruen at gmail.com> > wrote: > >> Hi Jack, >> >> It seems that the browser ignores different ports when handling session >> data (just a guess). Does it work if you change the session key of your >> second DBA instance [1]? >> >> Best, >> Christian >> >> [1] >> https://github.com/BaseXdb/basex/blob/df83d80238a27f3a168e3d5e88f984c819a37fb8/basex-api/src/main/webapp/dba/lib/config.xqm#L8-L9 >> >> >> On Wed, May 22, 2024 at 5:44 AM Jack Steyn <steynjack at gmail.com> wrote: >> >>> Hi, >>> >>> I have two separate BaseX installations on the same machine. Each has >>> its own set of databases and users. I run their HTTP servers >>> simultaneously, configured to their own sets of ports. >>> >>> When I authenticate to the DBA webapp of one, I am logged out of the DBA >>> webapp of the other. >>> >>> What might I do to prevent this? >>> >>> Best regards, >>> >>> Jack >>> >>

⚡Generated with XQuery