Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set Session Expiration Time Manually-CodeIgniter

How can I set session expiration time dynamically in codeigniter?

For example, if a user logs in and has the role of admin, the expiration time should be longer than if a user logs in who does not have an admin role.

Thanks.

like image 811
Siregar Avatar asked Aug 10 '11 04:08

Siregar


1 Answers

You can update your session expiration time by increasing this variable in config file:

$config['sess_expiration'] = 'somevalue'. 

Set $config['sess_expiration'] = 0, if you want it to never expire.

Here's a good discussion on CI forums:

Dynamically set configuration on session expire doesn’t work

like image 73
AlphaMale Avatar answered Sep 23 '22 06:09

AlphaMale