当前位置:网站首页>Laravel changed the session from file saving to database saving
Laravel changed the session from file saving to database saving
2022-07-07 16:21:00 【Full stack programmer webmaster】
1.laravel The default is to use file save session Of , Save in /storage/framework/sessions Next
2. Modify the configuration file config/session.php in ‘driver’ => env(‘SESSION_DRIVER’, ‘file’) take .env In the document SESSION_DRIVER The corresponding value is determined by file Change it to database, This means .env In file SESSION_DRIVER When the configuration item cannot be found , Just use file
3. stay .env The file is configured data library
4. Use the command to automatically generate and store session Data sheet for
php artisan session:table // Generate migration file After implementation /database/migrations/ Next add a new one with create_sessions_table.php The table at the end php artisan migrate // Add a new one in the database after execution sessions surface
5. The code uses session Way unchanged
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/113198.html Link to the original text :https://javaforall.cn
边栏推荐
- What are compiled languages and interpreted languages?
- 过度依赖补助,大客户收款难,冲刺“国产数据库第一股”的达梦后劲有多足?
- 招标公告:2022年云南联通gbase数据库维保公开比选项目(第二次)比选公告
- 【知识小结】PHP使用svn笔记总结
- Plate - forme de surveillance par étapes zabbix
- PyTorch 中的乘法:mul()、multiply()、matmul()、mm()、mv()、dot()
- Migration and reprint
- Odoo integrated plausible embedded code monitoring platform
- 分类模型评价标准(performance measure)
- Mysql database backup script
猜你喜欢
讲师征集令 | Apache SeaTunnel(Incubating) Meetup 分享嘉宾火热招募中!
C4D learning notes 3- animation - animation rendering process case
2022第四届中国(济南)国际智慧养老产业展览会,山东老博会
Xingruige database was shortlisted as the "typical solution for information technology application and innovation in Fujian Province in 2021"
航運船公司人工智能AI產品成熟化標准化規模應用,全球港航人工智能/集裝箱人工智能領軍者CIMC中集飛瞳,打造國際航運智能化標杆
C4D learning notes 1- animation - animation key frames
PyTorch 中的乘法:mul()、multiply()、matmul()、mm()、mv()、dot()
Eye of depth (VII) -- Elementary Transformation of matrix (attachment: explanation of some mathematical models)
SysOM 案例解析:消失的内存都去哪了 !| 龙蜥技术
Logback日志框架第三方jar包 免费获取
随机推荐
js中复选框checkbox如何判定为被选中
【HCSD大咖直播】亲授大厂面试秘诀-简要笔记
Laravel constructor and middleware execution order
2022第四届中国(济南)国际智慧养老产业展览会,山东老博会
Asyncio concept and usage
Plate - forme de surveillance par étapes zabbix
企业级日志分析系统ELK
What about the pointer in neural network C language
应用程序和matlab的通信方式
Laravel service provider instance tutorial - create a service provider test instance
统计学习方法——感知机
【花雕体验】15 尝试搭建Beetle ESP32 C3之Arduino开发环境
Xcode Revoke certificate
Dotween -- ease function
AE learning 01: AE complete project summary
SPI master RX time out interrupt
分步式監控平臺zabbix
MySQL数据库基本操作-DQL-基本查询
TiDB For PostgreSQL和YugabyteDB在Sysbench上的性能对比
Bidding announcement: Panjin people's Hospital Panjin hospital database maintenance project