当前位置:网站首页>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
边栏推荐
- Xcode Revoke certificate
- SPI master RX time out interrupt
- How to query the data of a certain day, a certain month, and a certain year in MySQL
- Bidding announcement: Panjin people's Hospital Panjin hospital database maintenance project
- Mysql database basic operation DQL basic query
- 【花雕体验】15 尝试搭建Beetle ESP32 C3之Arduino开发环境
- Xcode Revoke certificate
- Step by step monitoring platform ZABBIX
- Talk about the cloud deployment of local projects created by SAP IRPA studio
- Plate - forme de surveillance par étapes zabbix
猜你喜欢
2022 the 4th China (Jinan) International Smart elderly care industry exhibition, Shandong old age Expo
torch.numel作用
SysOM 案例解析:消失的内存都去哪了 !| 龙蜥技术
过度依赖补助,大客户收款难,冲刺“国产数据库第一股”的达梦后劲有多足?
Shandong old age Expo, 2022 China smart elderly care exhibition, smart elderly care and aging technology exhibition
航運船公司人工智能AI產品成熟化標准化規模應用,全球港航人工智能/集裝箱人工智能領軍者CIMC中集飛瞳,打造國際航運智能化標杆
Unity3d click events added to 3D objects in the scene
记一次项目的迁移过程
山东老博会,2022中国智慧养老展会,智能化养老、适老科技展
Unity3D_ Class fishing project, control the distance between collision walls to adapt to different models
随机推荐
Xcode Revoke certificate
删除 console 语句引发的惨案
深度之眼(六)——矩阵的逆(附:logistic模型一些想法)
Numpy -- data cleaning
The differences between exit, exit (0), exit (1), exit ('0 '), exit ('1'), die and return in PHP
hellogolang
Mysql database backup script
喜讯!科蓝SUNDB数据库与鸿数科技隐私数据保护管理软件完成兼容性适配
What is the difference between IP address and physical address
Communication mode between application program and MATLAB
Introduction to pyGame games
模仿企业微信会议室选择
Logback logging framework third-party jar package is available for free
AE learning 01: AE complete project summary
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
深度之眼(七)——矩阵的初等变换(附:数模一些模型的解释)
【HCSD大咖直播】亲授大厂面试秘诀-简要笔记
Apache Doris just "graduated": why should we pay attention to this kind of SQL data warehouse?
Rongyun won the 2022 China Xinchuang digital office portal excellence product award!
星瑞格数据库入围“2021年度福建省信息技术应用创新典型解决方案”