当前位置:网站首页>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
边栏推荐
- AB package details in unity (super detail, features, packaging, loading, manager)
- Shipping companies' AI products are mature, standardized and applied on a large scale. CIMC, the global leader in port and shipping AI / container AI, has built a benchmark for international shipping
- Plate - forme de surveillance par étapes zabbix
- Three. JS introductory learning notes 0: illustration of how webgl and threejs work
- How does geojson data merge the boundaries of regions?
- Description of vs common shortcut keys
- Postman generate timestamp, future timestamp
- 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"?
- 喜讯!科蓝SUNDB数据库与鸿数科技隐私数据保护管理软件完成兼容性适配
- [flower carving experience] 15 try to build the Arduino development environment of beetle esp32 C3
猜你喜欢
Three. JS introductory learning notes 05: external model import -c4d into JSON file for web pages
Three. JS introductory learning notes 00: coordinate system, camera (temporarily understood)
Shipping companies' AI products are mature, standardized and applied on a large scale. CIMC, the global leader in port and shipping AI / container AI, has built a benchmark for international shipping
Three. JS introductory learning notes 11:three JS group composite object
95. (cesium chapter) cesium dynamic monomer-3d building (building)
企业级日志分析系统ELK
Three. JS introductory learning notes 07: external model import -c4d to JSON file for web pages -fbx import
Performance comparison of tidb for PostgreSQL and yugabytedb on sysbench
How does geojson data merge the boundaries of regions?
过度依赖补助,大客户收款难,冲刺“国产数据库第一股”的达梦后劲有多足?
随机推荐
When opening the system window under UE4 shipping, the problem of crash is attached with the plug-in download address
Eye of depth (VI) -- inverse of matrix (attachment: some ideas of logistic model)
Dotween -- ease function
2022山东智慧养老展,适老穿戴设备展,养老展,山东老博会
Three. JS introductory learning notes 08:orbitcontrols JS plug-in - mouse control model rotation, zoom in, zoom out, translation, etc
Three. JS introductory learning notes 11:three JS group composite object
TCP framework___ Unity
Three. JS introductory learning notes 13: animation learning
The unity vector rotates at a point
Good news! Kelan sundb database and Hongshu technology privacy data protection management software complete compatibility adaptation
尤雨溪,来了!
121. 买卖股票的最佳时机
Talk about the cloud deployment of local projects created by SAP IRPA studio
AE learning 02: timeline
Three. JS introduction learning notes 12: the model moves along any trajectory line
Learn good-looking custom scroll bars in 1 minute
It's different for rich people to buy a house
一个普通人除了去工厂上班赚钱,还能干什么工作?
分步式监控平台zabbix
招标公告:2022年云南联通gbase数据库维保公开比选项目(第二次)比选公告