I want to know how session expires in CodeIgniter, because before $config['sess_expiration']
expires ie destroys, I want to insert the logout time of the particular user.I want to know where the flow goes so that I can write a query to insert user logout data.In which file session destroy code is.
Asked
Active
Viewed 379 times
1
1 Answers
1
Here you go:
if($login_var) {
$this->session->sess_expire_on_close = TRUE;
} else {
$this->session->sess_expire_on_close = FALSE;
}

Noman
- 1,459
- 2
- 18
- 38
-
,i have to take user id before session destroys automatically will it be Possible.to insert the logout time of particular user. – Ron Sep 08 '16 at 05:46
-
You have to apply condition when the user logout and save that time. – Noman Sep 08 '16 at 05:56
-
will it be possible to get the the time when session expire automatically. The 'time' when the user make no activity and session destroys. – Ron Sep 08 '16 at 05:59
-
This [Stack Overflow](http://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes) answer will help you a lot. – Noman Sep 08 '16 at 06:03
-
Thank for great help – Ron Sep 08 '16 at 06:06