views:

59

answers:

2

Hello guys,

Rarely our system mixes logged in users and I can't figure out why.

Here is the scenario: 2 users log in (A and B) normally each one has his own ID, at some point one of the users (A) takes the ID of the other user (B) and contribute to the website as if he is B.

Technically that's what is going on:

1- 2 users logs in: each user requests a "log in" action from Single Sign On(SSO) server which runs on PHP, and a session is created for each user (sessions are stored at Memcached-X)

2- The users have different IDs: Each user will have another session on the web server which runs on Ruby (RoR) also saves sessions on Memcached-Y. For each page they enter on RoR there is an iFrame check that request an authentication from the user browser to the SSO.

3- At some point user A becomes B and B stays as B: The log files from SSO show that the user A is still user A and user B is still user B, while the RoR's logs show that user A become B given that it still have the same session id. At that particular moment we checked keys coming out from RoR's memcached and they returned the right values.

What is going on ? Does SSO give wrong values to RoR,or does the RoR mix everything up or are the Memcached servers making mistakes ?

Please help I am running out of ideas... Thanks.

A: 

Is there some sort of time check when querying which session to use? If it's always user A turns into user B (I'm assuming here that user A logs in FIRST) then perhaps somewhere along the way user A looks up session info and sorts by time.

It sounds like it's in the communication between ROR and SSO, if both logs are confirming the correct user IDs/session IDs then it has to be somewhere in between when that check happens?

Viper_Sb
I dont know who logged in first, but they were both working fine, each one had his ID and all were happy, checks were fine as well. At one page reload A turns into B. Logs of RoR clearly shows that A became B so there were 2 B users with 2 different session tokens!
wael34218
Then must be on RoR side, perhaps there is a page that does some sort of session management and it gets confused somehow. Seems like it's not SOS in this case
Viper_Sb
A: 

It turned out that memcached that holds the session for RoR, was holding the same session information for 2 different session keys, either Ruby is mixing it up or Memcached, I highly doubt the later.

wael34218