Welcome Guest, Not a member yet? Register   Sign In
session time out if application remain idle
#1

[eluser]Harsh[/eluser]
Hi,

i am new in CI.
My requirement is "if application remain idle for 20 min then session will be timeout and it will redirect to login page".

Using CI library i have done that but that is not as per my requirement.

can anybody help me out to solve this problem using php script.

Thanks
Harsh
#2

[eluser]WanWizard[/eluser]
You can set the session expiration to 20min by assiging the value 1200 to the 'sess_expiration' config value.

Your controller should then check for a logged-in state (a session variable), and if not logged in, redirect to the login page. If this is true for all your controllers, you can use a MY_Controller extension, and do this check in the MY_Controller constructor (make sure your controllers extend MY_Controller instead of Controller).




Theme © iAndrew 2016 - Forum software by © MyBB