当前位置:网站首页>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
边栏推荐
- Migration and reprint
- C4D learning notes 3- animation - animation rendering process case
- What are compiled languages and interpreted languages?
- Eye of depth (VII) -- Elementary Transformation of matrix (attachment: explanation of some mathematical models)
- 分类模型评价标准(performance measure)
- Odoo integrated plausible embedded code monitoring platform
- IP地址和物理地址有什么区别
- 模仿企业微信会议室选择
- Markdown formula editing tutorial
- Enterprise log analysis system elk
猜你喜欢

Xcode Revoke certificate

C4D learning notes 2- animation - timeline and time function

Power of leetcode-231-2

强化实时数据管理,英方软件助力医保平台安全建设

Apache Doris刚“毕业”:为什么应关注这种SQL数据仓库?

过度依赖补助,大客户收款难,冲刺“国产数据库第一股”的达梦后劲有多足?

Unity3d click events added to 3D objects in the scene

喜讯!科蓝SUNDB数据库与鸿数科技隐私数据保护管理软件完成兼容性适配

C4D learning notes 1- animation - animation key frames

分步式监控平台zabbix
随机推荐
统计学习方法——感知机
How to implement backspace in shell
Leetcode-231-2的幂
Xcode Revoke certificate
Notification uses full resolution
Numpy -- data cleaning
prometheus api删除某个指定job的所有数据
Leetcode-136-只出现一次的数(用异或来解答)
Xingruige database was shortlisted as the "typical solution for information technology application and innovation in Fujian Province in 2021"
TCP framework___ Unity
Laravel 服务提供者实例教程 —— 创建 Service Provider 测试实例
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
星瑞格数据库入围“2021年度福建省信息技术应用创新典型解决方案”
Shader_ Animation sequence frame
Logback logging framework third-party jar package is available for free
Unity drawing plug-in = = [support the update of the original atlas]
PyTorch 中的乘法:mul()、multiply()、matmul()、mm()、mv()、dot()
SysOM 案例解析:消失的内存都去哪了 !| 龙蜥技术
torch.numel作用
Laravel post shows an exception when submitting data