Welcome Guest, Not a member yet? Register   Sign In
Session expired when computer is in idle
#2

[eluser]TheFuzzy0ne[/eluser]
The simplest solution is to simply set your session expiration to 30 minutes, but obviously, you have no way of telling whether or not a user was logged in before or not.

Here's what I do:
Set CodeIgniter sessions to last indefinitely.
When the user logs in, I set the time that their session should expire in the session data.
For each page request, I check that the expiry time hasn't passed. If it has, then the user is logged out and redirected to the login page with a message.
If their session has not expired, I re-set the expiry time.

You can put this functionality into a library, or into a base controller and extend it. It's simple enough.

Hope this helps.


Messages In This Thread
Session expired when computer is in idle - by El Forum - 03-13-2013, 10:42 PM
Session expired when computer is in idle - by El Forum - 03-14-2013, 01:04 AM
Session expired when computer is in idle - by El Forum - 03-14-2013, 01:10 AM
Session expired when computer is in idle - by El Forum - 03-14-2013, 09:51 AM
Session expired when computer is in idle - by El Forum - 03-14-2013, 07:36 PM
Session expired when computer is in idle - by El Forum - 03-15-2013, 05:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB