• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Session expiry time question

Hi Guys,

Sorry if this has been answered before but I did do a search and couldn't find anything relevant.

I am writing an app for a friend of mines business. It required users to login and everything seemed fine during testing. However we have hit a problem that I just cannot seem to get my head round.

$config['sess_expiration']        = 3600;
line sets the expiration of the session, but it seems to be regardless of user activity. Is there a way with CI to get the session expiry updated every time a user performs an action so the session expires after 3600 seconds of no activity??

Hope that made sense!!
Many Thanks.

How stupid do I feel!!!!

Problem solved, but there was never really a problem at all! Maybe this advice can be useful to anyone else who is just started with CI sessions!

To test the expiry of session I set the sess_expiration to 60 sec, but forgot the sess_time_to_update variable. I had the time to update set higher that the expiration so of course, if the session never updates it cannot stay alive and will always expire!!! DOH!

So advice to session newbie's, ALWAYS set your expiry time to a longer period than your update time!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.