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

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.

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

these lines:

$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;

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?

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

Maybe this is a better solution:

sorry man, are you using session library to work with users data?

what i mean is.... do you make this?:
in Login page:

and in Logout page:


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

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