FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP Session Timeout/Max Life Time





jinger89
Alright guys, I got a question about PHP sessions.

I'm currently using session to log users in and out. When they log in they are given a session id and such. However currently the session expires in about an hour, which is really annoying.

How do I set the expire/timeout/maxlifetime of a session to lets say 6 hours?
imagefree
in your php.ini file change the following value


Code:
session.gc_maxlifetime = 3600

3600 denotes seconds (as you said, session expire in an hour).

Change it to 21600. Like:

Code:
session.gc_maxlifetime = 21600
jinger89
where can i find my php.ini file?

i just spent some time poking through my file manager and can't seem to find it... :-/ I'm puzzled.
rvec
you can't on frihost, you don't have access.

You could save all your setting stuff to a mysql table and store a cookie on the user's pc. That way you can have more controll over the sessions and make sessions expire in 6 hours or even more (unles the user doesn't allow cookies, than you'd have to use the normal sessions).
sonam
You are allready get answer on this question in your previous topic:
http://www.frihost.com/forums/vt-109158.html

Sonam
rvec
-close- for above reason
Related topics
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.