Closed MightyPork closed 4 years ago
In Laravel 5 set your env value to: SESSION_DRIVER=database
and in config/session.php
'connection' => 'mongodb',
And the MongoDB driver will store values to the DB.
@dschreck thanks, but that in fact doesn't work
I'm currently using this with Laravel 5.2 and it has worked fine until I upgraded the PHP driver.
Are you using the new MongoDB driver rather than PHP's old Mongo drive by chance? I noticed that MongoDbSessionHandler.php is depending on the old Mongo driver.
I modified this file and got it to work again. See this gist:
https://gist.github.com/omanizer/fd3d2693dfd8e79e2244d47ef8b3f808
I'd like to get this implemented into this library so that it will work with the new driver.
FYI, this ended up being that symfony's MongoDbSessionHandler wasn't itself compatible with the new MongoDb PHP driver at the time. My gist above is no longer necessary when using a later version of Symfony.
In Laravel 5 set your env value to: SESSION_DRIVER=database
and in config/session.php
'connection' => 'mongodb',
And the MongoDB driver will store values to the DB.
correction:
Add in .env following lines: SESSION_DRIVER=database SESSION_CONNECTION=mongodb
got it working, four years later. thanks, @thche lol
"illuminate/session": "~4.0|~5.0"
,however it crashes whenever the driver is selected - some incompatibility with the Symfony session driver.
Error is thrown in
Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler
on line 73.