[Solved] duplicate database entry with database session driver - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17) +--- Thread: [Solved] duplicate database entry with database session driver (/showthread.php?tid=1091) |
[Solved] duplicate database entry with database session driver - betz0r - 02-10-2015 Hello, i am experiencing some troubles with the database session driver: Code: Error Number: 1062 How can i "catch" this error without modifing the core/session package but in the application code? I don't know where this duplicate entry is coming from and why it's happening, but it brakes the whole website... RE: duplicate database entry with database session driver - Narf - 02-11-2015 You've got sess_match_ip turned on, but you've kept only the 'session_id' field as primary key and you're visiting the site from another IP address ... RE: duplicate database entry with database session driver - betz0r - 02-11-2015 Thanks a lot, i read about the primary key earlier but forgot indeed to change it in my database. This is solved then! Keep on the good work ;-) RE: [Solved] duplicate database entry with database session driver - nnolting - 06-18-2015 I"m running into this error a lot and I think it's setup right. Query: Code: DROP TABLE `ci_sessions`; My session config (I needed a clause for when running tests): Code: $config['sess_driver'] = (defined('CODECEPTION_TEST') ? 'files' : 'database'); The error I get: Code: error - 2015-06-17 21:48:46 --> Query error: Duplicate entry 'fa431390cb8caae340986a0dbc751e2890890788' for key 'PRIMARY' - Invalid query: INSERT INTO `ci_sessions` (`id`, `ip_address`, `timestamp`, `data`) VALUES ('fa431390cb8caae340986a0dbc751e2890890788', '68.235.73.5', 1434595726, '') |