php - Multiple instances randomly signs out user -


i'm running yii-app on appfog. whenever try have more 1 instance no longer possible stay signed in.

i know multiple instances requires shared storage sessions, , have implemented using edmshttpsession. , work on localhost, can sign in, restart apache , remain signed in. also, if remove session record in database signed out. makes me conclude php using database storing sessions.

i can't understand why shared storage sessions doesn't work on appfog , i suggestions on how debug this.

some more background info:

  • i use cookies auto login. should valid 30 days (and according chrome inspector) never works more few hours (browser session guess) - not on localhost, not on appfog.
  • with multiple instances , autologin enabled (that click "remember me") still kicked out randomly, after 2 or 3 page refreshes. understand cookies should sign in automatically regardless of server sessions?
  • on appfog have ssl-endpoint, on localhost not.
  • i have checked shared session storage on appfog getting new sessions (looking in database tables)

update:

i did tests , perhaps results make sence one.

i clear cookies , restart appfog app. sign in, , check "remember me". following response set-cookie headers are:

set-cookie:phpsessid=vrfoi0o15v3qps2644uqtvkfa1; path=/   set-cookie:phpsessid=db38s1k1vp5ngll837ac0vh0u7; path=/   set-cookie:73dfaf673b71b1f92d34b8ab63dab17b=812bbcfd4f5b3be91f8c85d39c3b37bb93e4c6b8a%3a4%3a%7bi%3a0%3bs%3a24%3a%225087ea0b3145a75545000000%22%3bi%3a1%3bs%3a22%3a%22demo%40playbackenergy.se%22%3bi%3a2%3bi%3a2592000%3bi%3a3%3ba%3a0%3a%7b%7d%7d; expires=sun, 09-jun-2013 08:32:24 gmt; path=/ 

in subsequent request request cookie-headers are:

cookie:phpsessid=db38s1k1vp5ngll837ac0vh0u7; 73dfaf673b71b1f92d34b8ab63dab17b=812bbcfd4f5b3be91f8c85d39c3b37bb93e4c6b8a%3a4%3a%7bi%3a0%3bs%3a24%3a%225087ea0b3145a75545000000%22%3bi%3a1%3bs%3a22%3a%22demo%40playbackenergy.se%22%3bi%3a2%3bi%3a2592000%3bi%3a3%3ba%3a0%3a%7b%7d%7d 

i use "db38s1k1vp5ngll837ac0vh0u7" find session in database. row looks (note vrfoi0o15v3qps2644uqtvkfa1 not found in database):

{   "_id" : objectid("518cb0981045979e06000000"),   "data" : "73dfaf673b71b1f92d34b8ab63dab17b__id|s:24:\"5087ea0b3145a75545000000\";73dfaf673b71b1f92d34b8ab63dab17b__name|s:22:\"demo@playbackenergy.se\";73dfaf673b71b1f92d34b8ab63dab17b__states|a:0:{}73dfaf673b71b1f92d34b8ab63dab17brole|s:4:\"demo\";",   "expire" : 1368176186,   "id" : "db38s1k1vp5ngll837ac0vh0u7" } 

now restart appfog app again , try navigate page in app.now signed out.

the request cookie-headers before redirection login page (the same before):

cookie:phpsessid=db38s1k1vp5ngll837ac0vh0u7; 73dfaf673b71b1f92d34b8ab63dab17b=812bbcfd4f5b3be91f8c85d39c3b37bb93e4c6b8a%3a4%3a%7bi%3a0%3bs%3a24%3a%225087ea0b3145a75545000000%22%3bi%3a1%3bs%3a22%3a%22demo%40playbackenergy.se%22%3bi%3a2%3bi%3a2592000%3bi%3a3%3ba%3a0%3a%7b%7d%7d 

you asked suggestions on how debug, there go:

  • add different hidden strings each of instance layout files can see instance served current request
  • inspect cookies in request/response headers in browser find out, if same session id sent every request , when new 1 sent server

this may find out under condition session lost.

update

  • find out if session destroyed or if yii logs out. this, write session guest user , try if information lost @ reload.
  • disable allowautologin , see if works now.

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -