Welcome Guest, Not a member yet? Register   Sign In
$this->session_destroy();
#1

[eluser]Suhas nazir[/eluser]
Hello Every one i want to destroy all the session variables when i start with my home page.So for that I use $this->session_destroy(); but the previous session is still exist eventhough i write this code ..can any body help me please.............
#2

[eluser]WanWizard[/eluser]
The session library reads the current session when you load it. The session_destroy() method does remove the session itself, but not the information already loaded.

To fix this, extend the session library, and add this code to your extension:
Code:
/**
     * Destroy the current session
     *
     * Our version also destroys the session data loaded
     *
     * @access    public
     * @return    void
     */
    function sess_destroy()
    {
        // call the parent function
        parent::sess_destroy();

        // and reset the loaded userdata
        $this->userdata = array();
    }
#3

[eluser]Suhas nazir[/eluser]
Thaaaaaaaaaaaaaaaaaaaaaanks




Theme © iAndrew 2016 - Forum software by © MyBB