-1

I know there are questions like mine, but none answered my question:

In my .htaccess file, I have several rules of code ensuring sessions (loggin users in) are automatically started and last one week:

#Set PHP rules
php_value session.gc_maxlifetime 604800
php_value session.gc_probability 0
php_value session.cookie_lifetime 604800
php_value session.name "DSWLogin"
php_value session.auto_start 1

It works, sessions are automatically set with the name "DSWLogin" and last one week. However, when my browser restarts, the session and its content are reset, therefore logging the users automatically out.

So before the browser restart. Before the browser restarts http://www.projectomicron.org/Images/Before%20Browser%20Restart.png

And after the browser restart:

After the browser restarts http://www.projectomicron.org/Images/After%20Browser%20Restart.png

Isaiah
  • 1,852
  • 4
  • 23
  • 48
  • 1
    What about other browser? – sectus Jun 26 '13 at 12:48
  • We can only talk guesses here, as there is no way of 100% knowing what is causing this from the supplied information. Things I would suggest checking are, private browsing mode enabled in browser, Clear private information on browser close option or similar. However you cut it though, this seems to be a browser issue rather than a code issue. – Anigel Jun 26 '13 at 12:48
  • If you follow the specs of cookies, you can see that this might just be the case, so I wonder how that qualifies a question as this is documented behavior. The client has full control about expiring a cookie, what you tell via your server is only a recommendation to the client. – hakre Jun 26 '13 at 12:49
  • @Anigel Well, I use Google Chrome and Google Chrome (except in private browsing) doesn't even offer an option to clear private information on browser close. – Isaiah Jun 26 '13 at 12:50
  • 2
    Not true. Chrome does indeed have the option to automatically clear cookies on exit. Advanced settings > Content settings > Cookies > Select keep local data only until I quit my browser – Anigel Jun 26 '13 at 12:55
  • You're right! Though my "Allow local data to be set" was already checked... – Isaiah Jun 26 '13 at 13:00

1 Answers1

0

Well, it doesn't exactly answer my question but @sectus "What about other browser?" provided (unexpectedly enough) the missing link.

It turns out it was my browser, Google Chrome who reset my session, in FireFox it worked perfectly...

Isaiah
  • 1,852
  • 4
  • 23
  • 48
  • Though even Google Chrome is set to remember cookies after a browser restart, it doesn't... Does anyone know why? – Isaiah Jun 26 '13 at 19:06
  • Your question contains too little factual information to precisely say what is going on here. I suggest your trouble-shoot the issue with a network sniffer. Even your answer is descriptive only, it does not rely to any facts than just working / not working which is not a much qualified description, more a general describing one. – hakre Jun 26 '13 at 23:28