Welcome Guest, Not a member yet? Register   Sign In
CI destroy session takes too long?
#10

[eluser]HdotNET[/eluser]
Code:
function sess_destroy()
    {
        // Kill the session DB row
        if ($this->sess_use_database === TRUE AND isset($this->userdata['session_id']))
        {
            $this->CI->db->where('session_id', $this->userdata['session_id']);
            $this->CI->db->delete($this->sess_table_name);
        }

        // Kill the cookie
        setcookie(
                    $this->sess_cookie_name,
                    addslashes(serialize(array())),
                    ($this->now - 31500000),
                    $this->cookie_path,
                    $this->cookie_domain,
                    0
                );
    }

Mr Wales is right... but to fully understand why you need to look at the sess_destroy method above in the session class.

All it does is set the cookie data to nothing, and deletes the db session data if required.

In the session class constructor there is this:

Code:
// Run the Session routine. If a session doesn't exist we'll
        // create a new one.  If it does, we'll update it.
        if ( ! $this->sess_read())
        {
            $this->sess_create();
        }
        else
        {
            $this->sess_update();
        }

Therefore you haven't killed it even when you call $this->session->sess_destroy();

The $this->session->userdata array is still there.

Its only really destroyed once another request is made to the server.


Messages In This Thread
CI destroy session takes too long? - by El Forum - 01-24-2010, 09:25 PM
CI destroy session takes too long? - by El Forum - 01-24-2010, 09:56 PM
CI destroy session takes too long? - by El Forum - 01-24-2010, 10:13 PM
CI destroy session takes too long? - by El Forum - 01-25-2010, 06:45 AM
CI destroy session takes too long? - by El Forum - 01-25-2010, 06:51 AM
CI destroy session takes too long? - by El Forum - 01-25-2010, 07:52 AM
CI destroy session takes too long? - by El Forum - 01-25-2010, 10:01 AM
CI destroy session takes too long? - by El Forum - 01-25-2010, 10:08 AM
CI destroy session takes too long? - by El Forum - 01-25-2010, 10:17 AM
CI destroy session takes too long? - by El Forum - 01-25-2010, 10:39 AM
CI destroy session takes too long? - by El Forum - 01-25-2010, 06:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB