Welcome Guest, Not a member yet? Register   Sign In
Session quickfix
#1

[eluser]Maglok[/eluser]
I have just inherited a CodeIgniter application that works with sessions. I have read up quickly and am unsure of a piece of code:

Code:
if(strtolower($login[0]['title'][0]) == 'student')
            {
                $this->CI->session->set_userdata(array('student' => true));
            }
            if(strtolower($login[0]['title'][0]) == 'medewerker')
            {
                $this->CI->session->set_userdata(array('medewerker' => true));
            }
            //Destroy old session
            $this->CI->session->sess_destroy();
            
            //Create a fresh, brand new session
            $this->CI->session->sess_create();

I am wondering if this code uses a set_userdata() then destroys the old session and creates a new one, doesn't the code then just... Set something and delete it before using it?

I am trying to nail a problem with the login here and the session are just a tad bit confusing.


Messages In This Thread
Session quickfix - by El Forum - 06-18-2009, 08:08 AM
Session quickfix - by El Forum - 06-18-2009, 08:41 AM
Session quickfix - by El Forum - 06-19-2009, 12:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB