Reply to Sessions - how can I prevent users being logged out when inactive?

Your name:

Reply:


Posted by Dave Smithz on 07/11/05 02:32

Hi there,

Users of my PHP DB application have complained that it seems to log them out
every now and then. I actually assume this is when it has been idle for
sometime as I use session variables to store a logged in token.

With only basic knowledge of sessions I assumed there was some kind of
default time before the session data is destroyed.

Is this the case?

My investigations revealed a
session.cookie_lifetime
directive but the default value of 0 as in my environment means the cookie
lasts for ever so this could not be my problem.

The other directive was
session.cache_expire

which I do not fully understand if this would have an effect or not but it
may do. This has a default of 180 mins so I thought maybe users are being
logged out after 180 mins.

As an experiment I tried setting this to 1 min (>session_cache_expire(1); ),
but doing this and then checking if it was set with phpinfo() found that it
stayed at 180. Therefore I could not change the value.

So can anyone help. If I do have to set the
session.cache_expire
do I have to set this on each page where a session_start is used, or can I
just set it after the login page, and then the value I set will remain.

Any help on this matter appreciated.

Kind regards

Dave

[Back to original 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

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