I want to use database (currently, MySQL) to store session. But, when I tried to config, table sessions still has no record.
In file config/session.php when I change 'driver' => env('SESSION_DRIVER', 'file'),
'driver' => env('SESSION_DRIVER', 'database'),
'driver' => env('SESSION_DRIVER', 'redis'),
What should I change for 'connection' => null,
?
I tried:
'connection' => 'mysql',
with mysql is configured in app/database.php 'connection' => 'database.connections.mysql',
'connection' => Config::get('database.connections.mysql'),
got class not found error All you need to do is specify the right driver in the environment file, and generate the schema as outlined in the documentation .
This line:
'driver' => env('SESSION_DRIVER', 'database')
This is telling the config to get the SESSION_DRIVER
variable from your environment file, and use database
as a default. I can only assume you have forgotten to update your .env
file.
我不得不更改 .env 文件 config/session.php 中的 SESSION_DRIVER=database 更改对我不起作用
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.