Note that there are some explanatory texts on larger screens.

plurals
  1. POMultiple instances randomly signs out user
    primarykey
    data
    text
    <p>I'm running a Yii-app on Appfog. Whenever I try to have more than 1 instance it is no longer possible to stay signed in.</p> <p>I know that multiple instances requires a shared storage for sessions, and I have implemented that using EDMSHttpSession. And it does work on localhost, that is I can sign in, restart Apache and remain signed in. Also, if I remove the session record in the database I am signed out. This makes me conclude that PHP is using the database for storing sessions.</p> <p>I can't understand why my shared storage for sessions doesn't work on Appfog and <strong>I would like suggestions on how to debug this.</strong></p> <p>Some more background info: </p> <ul> <li>I use cookies for auto login. They should be valid for 30 days (and they are according to Chrome inspector) but that never works for more then a few hours (browser session I guess) - not on localhost, not on Appfog. </li> <li>With multiple instances and autologin enabled (that is I click "remember me") I still get kicked out randomly, usually after 2 or 3 page refreshes. As I understand a cookies should sign you in automatically regardless of server sessions?</li> <li>On Appfog i have a SSL-endpoint, on localhost I do not.</li> <li>I have checked that my shared session storage on Appfog is getting new sessions (looking in the database tables)</li> </ul> <p><strong>Update:</strong></p> <p>I did some tests and perhaps my results will make sence to some one.</p> <p>I clear all Cookies and restart my Appfog app. I sign in, and check "Remember me". Now the following response Set-cookie headers are:</p> <pre><code>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=/ </code></pre> <p>In the subsequent request the request Cookie-headers are:</p> <pre><code>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 </code></pre> <p>I use <code>"db38s1k1vp5ngll837ac0vh0u7"</code> to find my session in the database. That row looks like this (note that <code>vrfoi0o15v3qps2644uqtvkfa1</code> is not found in the database):</p> <pre><code>{ "_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" } </code></pre> <p>Now I restart my Appfog app again and try to navigate to another page in my app.Now I get signed out.</p> <p>The request Cookie-headers before redirection to login page were (the same as before):</p> <pre><code>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 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload