Welcome Guest, Not a member yet? Register   Sign In
Destroyed session with closed browser
#1

[eluser]babazumbula[/eluser]
Hi,
I made Login application,and loguot is via sess_destroy() function. It works well. However session doesn't get destroyed when browser is closed. This is what I want to achieve. If user forget logout link,I want session to be destroyed with each closing browser.
I've been looking through user guide, but seems like can't find the answer.
#2

[eluser]Bart v B[/eluser]
you need to edit /application/config.php

these lines:

Code:
$config['sess_cookie_name']    = 'ci_session';
$config['sess_expiration']    = 7200; // this to 1 or something
$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;
#3

[eluser]babazumbula[/eluser]
If I put 1 that means cookie will expire in one sec? What if I want to redirect them to other member's page which needs this cookie?
#4

[eluser]Bart v B[/eluser]
hmmm. did not thought aboute that.. :red:

Maybe this is a better solution:
http://ellislab.com/forums/viewthread/109645/#553043
#5

[eluser]Ngulo[/eluser]
sorry man, are you using session library to work with users data?

what i mean is.... do you make this?:
in Login page:
Code:
$this->session->set_userdata('user');

and in Logout page:

Code:
$this->session->unset_userdata('user');

??
is this what's gonna creating problems to you?

for me there's no problem in users Login and Logout using session library

probably i didn't mean the way you're looking to make the login-logout app Tongue
#6

[eluser]WanWizard[/eluser]
The search engine would have revealed http://ellislab.com/forums/viewthread/128927/#636611, where I describe a solution to this problem (which is that CI doesn't interpret a zero value as 'valid till end of browser session', but defaults to two hours).




Theme © iAndrew 2016 - Forum software by © MyBB