Welcome Guest, Not a member yet? Register   Sign In
Bug in Session.php CI 1.7.3
#1

[eluser]Daniel_C[/eluser]
In the session user guide we have that to store a session in the database we have to run these sql statements:
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)
);

In Session.php
Code:
(line 309) $this->userdata = array(
'session_id'     => md5(uniqid($sessid, TRUE)),
'ip_address'     => $this->CI->input->ip_address(),
'user_agent'     => substr($this->CI->input->user_agent(), 0, 50),
'last_activity'    => $this->now
);

The problem is that user_data is NOT NULL and in the last code there is not a user_data value, so the row is never inserted in the database because it shows an error:
ERROR 1364 (HY000): Field 'user_data' doesn't have a default value


Messages In This Thread
Bug in Session.php CI 1.7.3 - by El Forum - 12-22-2010, 11:13 AM
Bug in Session.php CI 1.7.3 - by El Forum - 12-22-2010, 12:04 PM
Bug in Session.php CI 1.7.3 - by El Forum - 12-23-2010, 03:53 AM
Bug in Session.php CI 1.7.3 - by El Forum - 12-23-2010, 06:08 PM
Bug in Session.php CI 1.7.3 - by El Forum - 12-23-2010, 06:11 PM
Bug in Session.php CI 1.7.3 - by El Forum - 12-23-2010, 11:20 PM
Bug in Session.php CI 1.7.3 - by El Forum - 12-24-2010, 02:31 AM
Bug in Session.php CI 1.7.3 - by El Forum - 12-24-2010, 08:57 AM



Theme © iAndrew 2016 - Forum software by © MyBB