CodeIgniter Forums

Full Version: After session->sess_destroy() redirect to another site and session persist.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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

El Forum

[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

El Forum

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

El Forum

[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();