![]() |
session time out if application remain idle - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: session time out if application remain idle (/showthread.php?tid=36552) |
session time out if application remain idle - El Forum - 12-06-2010 [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 session time out if application remain idle - El Forum - 12-06-2010 [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). |