CodeIgniter Forums
Code Igniter DB backed sessions user_data DEFAULT - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Code Igniter DB backed sessions user_data DEFAULT (/showthread.php?tid=40219)



Code Igniter DB backed sessions user_data DEFAULT - El Forum - 04-01-2011

[eluser]blasto333[/eluser]
It appears in version 1.7.x the database table for sessions didn't have a default for user_data and now in version 2, it does. Should I be doing this for version 1.7.x installs. It appears some users of the application have run into issues when mysql strict mode is on.


Is this the right code?
Code:
CREATE TABLE `phppos_sessions` (
  `session_id` varchar(40) NOT NULL DEFAULT '0',
  `ip_address` varchar(16) NOT NULL DEFAULT '0',
  `user_agent` varchar(50) NOT NULL,
  `last_activity` int(10) unsigned NOT NULL DEFAULT 0,
  `user_data` text NOT NULL DEFAULT '',
  PRIMARY KEY (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;