当前位置:网站首页>laravel中将session由文件保存改为数据库保存
laravel中将session由文件保存改为数据库保存
2022-07-07 14:07:00 【全栈程序员站长】
1.laravel中默认是使用文件保存session的,保存在/storage/framework/sessions下
2.修改配置文件 config/session.php中 ‘driver’ => env(‘SESSION_DRIVER’, ‘file’) 将.env文件中的SESSION_DRIVER对应值由file改为database,这里的意思是.env文件中 SESSION_DRIVER配置项找不到的情况下,就使用file
3.在.env文件中配置好数据库
4.使用命令自动生成存放session的数据表
php artisan session:table //生成迁移文件 执行后在/database/migrations/下新增一个以create_sessions_table.php结尾的表 php artisan migrate //执行后数据库中新增一个sessions表
5.代码中使用session方式不变
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/113198.html原文链接:https://javaforall.cn
边栏推荐
- C4D learning notes 3- animation - animation rendering process case
- Mysql database basic operation DQL basic query
- AB package details in unity (super detail, features, packaging, loading, manager)
- hellogolang
- How to determine whether the checkbox in JS is selected
- 【花雕体验】15 尝试搭建Beetle ESP32 C3之Arduino开发环境
- Three. JS introductory learning notes 18: how to export JSON files with Blender
- Plate - forme de surveillance par étapes zabbix
- Mesh merging under ue4/ue5 runtime
- numpy--疫情数据分析案例
猜你喜欢

Excessive dependence on subsidies, difficult collection of key customers, and how strong is the potential to reach the dream of "the first share of domestic databases"?

Shandong old age Expo, 2022 China smart elderly care exhibition, smart elderly care and aging technology exhibition

numpy--数据清洗

Strengthen real-time data management, and the British software helps the security construction of the medical insurance platform

The unity vector rotates at a point

Apache Doris just "graduated": why should we pay attention to this kind of SQL data warehouse?

It's different for rich people to buy a house

Xcode Revoke certificate

SPI master RX time out interrupt

SPI master rx time out中断
随机推荐
Application example of infinite list [uigridview]
Eye of depth (VII) -- Elementary Transformation of matrix (attachment: explanation of some mathematical models)
讲师征集令 | Apache SeaTunnel(Incubating) Meetup 分享嘉宾火热招募中!
Xingruige database was shortlisted as the "typical solution for information technology application and innovation in Fujian Province in 2021"
Whole process analysis of unity3d rendering pipeline
torch.numel作用
Three. Introduction to JS learning notes 17: mouse control of 3D model rotation of JSON file
Numpy --- basic learning notes
A link opens the applet code. After compilation, it is easy to understand
markdown公式编辑教程
保证接口数据安全的10种方案
Three. JS introductory learning notes 0: illustration of how webgl and threejs work
What are compiled languages and interpreted languages?
20th anniversary of agile: a failed uprising
Odoo集成Plausible埋码监控平台
Align individual elements to the right under flex layout
There are many ways to realize the pause function in JS
Unity drawing plug-in = = [support the update of the original atlas]
What about the pointer in neural network C language
How to determine whether the checkbox in JS is selected