Welcome Guest, Not a member yet? Register   Sign In
sess_time_to_update
#1

[eluser]Satch[/eluser]
I want to turn this off. I tried to set it to a large number but it didn't work. Any suggestions?

Code:
$config['sess_cookie_name']        = 'carwrap';
$config['sess_expiration']        = 72000;
$config['sess_encrypt_cookie']    = FALSE;
$config['sess_use_database']    = TRUE;
$config['sess_table_name']        = 'sessions';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent']    = TRUE;
$config['sess_time_to_update']         = 300000;
#2

[eluser]antiver[/eluser]
What version of CI are you using?
#3

[eluser]Satch[/eluser]
1.6.2
#4

[eluser]Satch[/eluser]
any suggestions?
#5

[eluser]Derek Allard[/eluser]
Hey Satch, you could hack or extend the session class, and I can help you with that, but first maybe we can work around it for you. Why do you want it disabled? Time to update determines how often the session will be regenerated, not how long it will last for just to be clear.
#6

[eluser]Satch[/eluser]
I have values in the db that are attached to session ids. If it auto expires, I have that data left in the db. I'd rather have it not expire or at least, if it expires, all data is set to empty strings

Thanks
#7

[eluser]Derek Allard[/eluser]
Is that data from the CI session class or did you custom code it. It its from CI session, that will get cleaned up automatically by the system.
#8

[eluser]pawz[/eluser]
I would also like to know how to disable this, for the reason that I want to be able to have infinite sessions, and be able to attach multiple sessions to a particular userid, so that I can track information for them from multiple locations/sessions. I need to turn session update off (easily rather than by hacking it) to achieve this. Can't this be an option in the config please ?

-UPDATE-

just realised you can do so by setting it to false. my bad !
#9

[eluser]mumrah[/eluser]
I had some issues similar to this. The code you're looking for is in system/Session.php in the sess_update function.

I wrote about my issue and the resolution in my blog.

-David
#10

[eluser]Unknown[/eluser]
Since the session id changes automatically, you have to store a second id for your application session handling. The data stored inside the cookie doesn't change, so you can rely on this id.

Code:
$session_id = $this->session->userdata('session_id');
$cookie_id = $this->session->userdata('cookie_id');
if ($cookie_id === false) {
$cookie_id = $session_id;
$this->session->set_userdata('cookie_id', $cookie_id);
}

In this example, use $cookie_id as your application session identifier, not $session_id.




Theme © iAndrew 2016 - Forum software by © MyBB