CodeIgniter Forums
After session->sess_destroy() redirect to another site and session persist. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: After session->sess_destroy() redirect to another site and session persist. (/thread-54732.html)



After session->sess_destroy() redirect to another site and session persist. - El Forum - 09-22-2012

[eluser]frankabel[/eluser]
Hi all,

I call:

Code:
$this->session->sess_destroy()


in one of my controller, then I call:

Code:
redirect('otherdomain.com');

So far so good, but when I put in my browser the URL of my site again, I can see that session is not distroyed.

What is wrong here?

Thanks in advanced
Frank


After session->sess_destroy() redirect to another site and session persist. - El Forum - 09-22-2012

[eluser]ojcarga[/eluser]
Hi,

What you must know is that even if you call sess_destroy() this info will persists in session:

Array
(
[session_id] => 0fe1946fc263b674f995g7s07b5510se
[ip_address] => xxx.xxx.xxx.xxx
[user_agent] => Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1
[last_activity] => 3125649874
[user_data] =>
)

so, if that is the problem, it is not a problem at all. Smile


After session->sess_destroy() redirect to another site and session persist. - El Forum - 09-22-2012

[eluser]frankabel[/eluser]
Thanks for your help.


After session->sess_destroy() redirect to another site and session persist. - El Forum - 09-22-2012

[eluser]PhilTem[/eluser]
It's always best to do both, destroying the old session and starting a new one. Try this to get a clean, new session:

Code:
$this->session->sess_destroy();
$this->session->sess_create();