Welcome Guest, Not a member yet? Register   Sign In
CI Session expire after exactly 5 minutes
#1

[eluser]Sergiu D[/eluser]
Hello there...

I've opened this new topic, to ask a question about CodeIgniter session. I have this case, when I am using the session ID to perform checking for a shop webpage. Based on session ID and IP address I check if there is any items in the basket, and so on.

Now, the problem occurs when the user session expire, exactly after 5 seconds, no matter what I do. Even if I am idle or not on that page, it will still expire.

My configuration looks like this:
Code:
$config['sess_cookie_name']     = 'ci_session';
$config['sess_expiration']      = 7200;
$config['sess_encrypt_cookie']  = TRUE;
$config['sess_use_database']    = FALSE;
$config['sess_table_name']      = 'ci_sessions';
$config['sess_match_ip']        = TRUE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update']  = 300;

So, given that, I aspect all the sessions to expire olny after two hours. I am not doing any flush, anywhere.

Is this something related to php.ini configuration, or is related to CI? Can somebody point me where to look? Thanks...

PS: I am using Google Chrome, but this behavior persist to IE8, Safari, Opera, Firefox.
#2

[eluser]WanWizard[/eluser]
Which browser? IE doesn't like the underscore in the cookie name. Also make sure cookie_domain en path is set properly.

Did you check the expiration timestamp of the cookie that is created in the browser? Are you sure the time of your webserver and of your PC is absolutely correct?
#3

[eluser]Clooner[/eluser]
Actually session id will change every 5 minutes exactly!
Code:
$config['sess_time_to_update']  = 300;

it is bad practice to use the session id for checking this! generate your own id and check versus your own generated id on not the session id!
#4

[eluser]Sergiu D[/eluser]
[quote author="clooner" date="1276175120"]Actually session id will change every 5 minutes exactly!
Code:
$config['sess_time_to_update']  = 300;

it is bad practice to use the session id for checking this! generate your own id and check versus your own generated id on not the session id![/quote]
Hmm... interesting point indeed. I did not check to see if the session ID change, and now actually hit me, because I have other sessions there that are fine. Only the session ID "expire".

Thanks for the advice, I understand now what is happening.




Theme © iAndrew 2016 - Forum software by © MyBB