Destroyed session with closed browser |
[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.
[eluser]Bart v B[/eluser]
you need to edit /application/config.php these lines: Code: $config['sess_cookie_name'] = 'ci_session';
[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?
[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
[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
[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). |
Welcome Guest, Not a member yet? Register Sign In |