Jump to content


Photo

Session expiration question


  • Please log in to reply
2 replies to this topic

#1 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 22 June 2006 - 02:43 AM

session_set_cookie_params(60*60*24*180,"/",".".$_SERVER['SERVER_NAME']);
session_start();

So, the session cookie is set to expire in 180 days, but the server kills it after a few hours. can session_cache_expire() fix this, or do I need to change something in the php.ini?

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 22 June 2006 - 02:47 AM

Honestly... if you need to store your sessions more than an hour you need to use cookies. Dont foget sessions take up room on the server aswell.

#3 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 22 June 2006 - 02:55 AM

I am recording whether a visitor is allowed access to a certain area of the website without requiring them to login.

I could store the sessionid in mysql, but the complexities begin: can I capture the PHPSESSID cookie and verify the existance of that session on the server before running session_start?

If the session does not exist, I could query mysql for the content and repopulate the new session -- but this does seem like the long way around.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users