In CodeIgniter config.php file,we can set session expire time in seconds $config['sess_expiration'] = 300;.
Now I have two part for my web site,user part and admin part.I need user session expires after 10 minutes(600sec) and admin session expires after 5 minutes(300sec) .
Is there any easy way to do it?
In CodeIgniter config.php file,we can set session expire time in seconds $config[‘sess_expiration’] = 300;
Share
I think the easiest is to replace the current
CI_Sessioninstance within your admin with a new instance having those options passed in the$paramsarray in the constructor.The other variant would be that you extend the
CI_Sessionclass with your own variant which offers a method to change expiration time or can deal with a second config item which it’s processes conditionally.