Welcome Guest, Not a member yet? Register   Sign In
sess_expiration has no effect on sessions
#1

(This post was last modified: 06-16-2015, 07:50 AM by codeIgniter2015. Edit Reason: Update )

Session expiration does not seem to have any effect on my session variables.

Below is my session config:
PHP Code:
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_sessions3';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = TRUE

Please correct me if I am wrong but since I have set my sess_expiration to 2 hours, I would expect that all my sessions variables would be destroyed after 2 hours. But no matter what I set my sess_expiration, the sessions variables are always available once set.

I do have a AJAX running on that page updating a value every 10 seconds.

Is there something that I am missing here?

Thanks in advance.
Reply
#2

Yes, your AJAX script is keeping the session alive ... sess_expiration has an effect over inactive sessions.
Reply
#3

Thanks for the response. I added another session variable to keep a track of logged in time.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB