WebSockets handling multiple tokens

ikerllona 6 years ago

I have created a group A with an user A and devices A1, A2, A3... asigned to that group A. I have a token A for them. I have also created the same group B, user B, devices B1, B2, B3... and I have the token B.

I´m using the simple web app example to create two pages A and B, using the token of each of them.

If I open those two pages in the same browser in two different tabs, it does not show me the position data for each token. I assume that what is happening is that if I load first the page A, the cookie is created for that token A, and then if I load the page B, the cookie is not correct for token B.

Do you know how can I handle different tokens in the same browser in different tabs?

Thanks for your help

John 6 years ago

I think you have to find more about jsession cookie creation.
as I know, it only create at the first time login, next time use, exsisting key.

Anton Tananaev 6 years ago

The only way to achieve it is by using two different domain names. Session cookies are per domain.

ikerllona 6 years ago

Thanks for the answers.

I´m testing deleting the JSESSIONID each time the page loads before creating the session. It seems to work for different tokens as I described in my issue, but, do you think there could be any problems if I do that?

document.cookie = "JSESSIONID=";
Primtek 5 years ago

I am facing the same problem.. I don't understand why traccar uses the same JSESSIONID for different access token?, what should we do if we want to view 3 devices on the same browser on different tab (ie. device A on tab1, device B on tab2, device C on tab3).. ?

please help