Welcome Guest, Not a member yet? Register   Sign In
CI 1.7 Session destroy
#1

[eluser]Thorpe Obazee[/eluser]
I am having quite a problem with the $this->session->sess_destroy()

When I use it, I can still echo the session variable. Here's what my code looks like. I am using CI 1.7
Code:
$this->session->sess_destroy();
        $this->session->set_flashdata('message', $this->lang->line('user_logged_out'));
        redirect('classifieds');
#2

[eluser]Thorpe Obazee[/eluser]
ok.. I just tested the others and found out that the other logout routines are now not working on my app since the upgrade to 1.7.
#3

[eluser]Thorpe Obazee[/eluser]
The temporary fix I did was to unset_userdata first before the destroy. although I doubt that the destroy worked.
Code:
// --------------------------------------------------------------------

    /**
    * @desc Logging  out action for the application
    *
    * @access public
    */
    public function logout()
    {
        $this->session->unset_userdata('username');
        $this->session->unset_userdata('first_name');
        $this->session->unset_userdata('last_name');
        $this->session->unset_userdata('role');
        $this->session->sess_destroy();
        $this->session->set_flashdata('message', $this->lang->line('user_logged_out'));
        redirect('classifieds');
    } // End logout
#4

[eluser]Genki1[/eluser]
Yes, we are having the same problem. In the library Session.php, destroying a session only deals with the cookie; it doesn't deal with the session variables.
#5

[eluser]nizsmo[/eluser]
sess_destroy() is working fine for me with the session data stored in the database Smile For me calling the sess_destroy will actually delete the session database entry completely. Not sure why its not working for you guys?
#6

[eluser]Genki1[/eluser]
Please give an example of a reliable technique for determining whether or not the user's session is active.

Thank you
#7

[eluser]Thorpe Obazee[/eluser]
[quote author="nizsmo" date="1225109898"]sess_destroy() is working fine for me with the session data stored in the database Smile For me calling the sess_destroy will actually delete the session database entry completely. Not sure why its not working for you guys?[/quote]

I am not using any database to store the session.

I might use the database for storing sessions. Will be converting on the weekends.
#8

[eluser]RogerM[/eluser]
I am using a database to hold sessions.
I also have set 2 userdata variables.
When I call sess_destroy, it deletes the record in the database, but I am still able to echo my userdata.

My temporary fix is to use session->unset_userdata().

Any thoughts?
#9

[eluser]bapobap[/eluser]
#10

[eluser]Thorpe Obazee[/eluser]
[quote author="RogerM" date="1226100949"]I am using a database to hold sessions.
I also have set 2 userdata variables.
When I call sess_destroy, it deletes the record in the database, but I am still able to echo my userdata.

My temporary fix is to use session->unset_userdata().

Any thoughts?[/quote]

I guess we are having the same issue.




Theme © iAndrew 2016 - Forum software by © MyBB