Welcome Guest, Not a member yet? Register   Sign In
Database data overwrites Session data ?
#1

[eluser]Unknown[/eluser]
I'm trying to write some code that verifies that a user is valid and logged in by using the session library.

For this, I want to generate a random hash that is placed as part of the custom data. To verify that the user is logged in, I will proceed to compare the cookie with the db data, but I cant because the session data is overwritten by the database data on read. Therefore I have no idea what the actual cookie data was.

Line 216- Session.php
Code:
// Is there custom data?  If so, add it to the main session array
            $row = $query->row();
            if (isset($row->user_data) AND $row->user_data != '')
            {
                $custom_data = $this->_unserialize($row->user_data);

                if (is_array($custom_data))
                {
                    foreach ($custom_data as $key => $val)
                    {
                        $session[$key] = $val;
                    }
                }
            }

It might be best to either remove this code or to assign it to session->dbdata




Theme © iAndrew 2016 - Forum software by © MyBB