I recently updated a project to use Laravel 5.2 and am having some sporadic exceptions like the following picked up by Sentry:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '403f212667d4940b3524a352f983cbe05057b035' for key 'sessions_id_unique' in /path/to/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:408
- I use the database session driver
- I've not modified the default session middleware or driver code
- My database table is the default with a 255 varchar unique key for the
sessions.id
My session.php looks like following
<?php
return [
'driver' => env('SESSION_DRIVER', 'file'),
'lifetime' => 120,
'expire_on_close' => false,
'encrypt' => false,
'files' => storage_path('framework/sessions'),
'connection' => null,
'table' => 'sessions',
'lottery' => [2, 100],
'cookie' => 'worldwalking',
'path' => '/',
'domain' => null,
'secure' => false,
'http_only' => true,
];
If anyone has experienced this problem and fixed, or has any thoughts, I'd be very grateful for a heads up or any advice.
Thank in advance :)