• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$this->session->sess_destroy(); didn't destroy all session?

#1
[eluser]Alpha[/eluser]
hi, i have $this->session->set_userdata('user_id', 'ID1');

then i want to logout and used $this->session->sess_destroy();
but to my surprise $this->session->set_userdata('user_id', 'ID1') still exist, see below how i used $this->session->sess_destroy();

$this->load->view('index', $data);
$this->session->sess_destroy();

tnx

#2
[eluser]WanWizard[/eluser]
It destroys the session, but doesn't empty the userdata array already loaded.

#3
[eluser]Alpha[/eluser]
i get it, user_data uses session database and ci session is not like php native session wherein once u run session destroy all data stored in session object will be destroyed

tnx Smile

#4
[eluser]Alpha[/eluser]
based on http://ellislab.com/codeigniter/user-gui...sions.html session destroy should destroy all items but why user_data still exist?

#5
[eluser]WanWizard[/eluser]
As I said, sess_destroy() doesn't empty the user_data array.

It's a 'bug/feature' that's been there since the beginning of time. If this is a problem for you, either report it to have it fixed, or extend the session class and erase it yourself.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.