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 b
You can handle this with a custom controller. When a user logs in, set a session variable with the time of login. Create custom controller that contains a function in the constructor to check if the user is not admin user and if the timeout has expired. If it has, call $this->session->destroy(); Now, make all your controllers extend that controller instead of the CI base controller.