You are here: Re: session expiration « PHP Programming Language « IT news, forums, messages
Re: session expiration

Posted by Erwin Moller on 11/16/14 11:29

Meiao wrote:

> Depends on his cookies setting and you Session configuration (if you
> session uses cookies or the query string).
>
> If user doesn't delete cookies when his browser closes (and your
> Session uses cookies) then I guess the Session would be fine.

No, not under standard circumstances.

The COOKIE will be fine, true, but the sessiondata will be
garbaged-collected or time-out by timestamp.
So PHP cannot restore the session and will start a new session.

PHP will clean up old sessionfiles, and PHP decides when a file is old by
using php.ini settings.
I think default is half an hour.


>
> One more thing, Session data is (generally) saved in a file under /tmp
> if files there get deleted, Session variable will be gone.

Even when they file was for some reason NOT garbage collected, PHP checks
the timestamp, and decides it is old, and will not use it.
(This can happen if you disable garbage collection by making the chances for
it happening extremely small in php.ini)

To make the original posters scenario work, you need to make sessions last
for weeks, or months or whatever.
Not really a good thing to do, resourcewise. :-)

Regards,
Erwin Moller

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация