Welcome Guest, Not a member yet? Register   Sign In
Problem with Sessions
#1

[eluser]Unknown[/eluser]
Hello everyone, there is a problem with the "sessions" table.When you enable "user agent" (which is by default enabled) it save the "user agent" in the database but in the documentation the size is limited to 50 characters

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 DEFAULT '' NOT NULL,
PRIMARY KEY (session_id)
);



The framework can't guess the size of the user agent because in the database it's limited to 50

example on framework : Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:6.0) Gecko/20100101 Firefox/6.0

and example with database stored value : Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:6

The solution is to replace on all documentations ( http://ellislab.com/codeigniter/user-gui...sions.html ) the number 50 by 255 in the SQL query.

Thanks !




Theme © iAndrew 2016 - Forum software by © MyBB