Welcome Guest, Not a member yet? Register   Sign In
CI session library BUG?
#1

[eluser]vps4[/eluser]
/* Location: ./system/libraries/Session.php */
line: 270-282

Code:
if (count($custom_userdata) === 0)
        {
            $custom_userdata = '';
        }
        else
        {
            // Serialize the custom data array so we can store it
            $custom_userdata = $this->_serialize($custom_userdata);
        }

        // Run the update query
        $this->CI->db->where('session_id', $this->userdata['session_id']);
        $this->CI->db->update($this->sess_table_name, array('last_activity' => $this->userdata['last_activity'], 'user_data' => $custom_userdata));

AND http://ellislab.com/codeigniter/user-gui...sions.html

Code:
CREATE TABLE IF NOT EXISTS  `ci_sessions` (
session_id varchar(40) DEFAULT '0' NOT NULL,
ip_address varchar(16) DEFAULT '0' NOT NULL,
user_agent varchar(50) NOT NULL,
last_activity int(10) unsigned DEFAULT 0 NOT NULL,
user_data text NOT NULL,
PRIMARY KEY (session_id)
);

the bug is:

Code:
user_data text NOT NULL
when
Code:
$custom_userdata = '';


this line will get error:
Code:
$this->CI->db->update($this->sess_table_name, array('last_activity' => $this->userdata['last_activity'], 'user_data' => $custom_userdata));

How can I fix it?
change database table to :
Code:
user_data text NULL

OR modify
/* Location: ./system/libraries/Session.php */
like:
Code:
if (count($custom_userdata) === 0)
        {
            $custom_userdata = '';
                        return false;
        }


Messages In This Thread
CI session library BUG? - by El Forum - 06-15-2009, 05:22 AM
CI session library BUG? - by El Forum - 06-15-2009, 05:28 AM
CI session library BUG? - by El Forum - 06-15-2009, 05:29 AM
CI session library BUG? - by El Forum - 06-15-2009, 05:33 AM
CI session library BUG? - by El Forum - 06-15-2009, 05:37 AM
CI session library BUG? - by El Forum - 06-15-2009, 12:50 PM
CI session library BUG? - by El Forum - 06-15-2009, 12:58 PM
CI session library BUG? - by El Forum - 06-15-2009, 01:12 PM
CI session library BUG? - by El Forum - 06-15-2009, 01:57 PM
CI session library BUG? - by El Forum - 06-15-2009, 02:03 PM
CI session library BUG? - by El Forum - 06-15-2009, 09:47 PM
CI session library BUG? - by El Forum - 06-16-2009, 01:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB