当前位置:网站首页>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
边栏推荐
- 讲师征集令 | Apache SeaTunnel(Incubating) Meetup 分享嘉宾火热招募中!
- 修改配置文件后tidb无法启动
- Laravel5.1 路由 -路由分组
- L'application à l'échelle de la normalisation mature des produits ai des compagnies maritimes, cimc, leader mondial de l'intelligence artificielle portuaire et maritime / intelligence artificielle des
- Three. JS introductory learning notes 19: how to import FBX static model
- C4D learning notes 3- animation - animation rendering process case
- MySQL中, 如何查询某一天, 某一月, 某一年的数据
- Aerospace Hongtu information won the bid for the database system research and development project of a unit in Urumqi
- torch.numel作用
- 分步式监控平台zabbix
猜你喜欢

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

Leetcode-231-2的幂

AE learning 01: AE complete project summary

Step by step monitoring platform ZABBIX

华东师大团队提出,具有DNA调控电路的卷积神经网络的系统分子实现

模仿企业微信会议室选择

讲师征集令 | Apache SeaTunnel(Incubating) Meetup 分享嘉宾火热招募中!
通知Notification使用全解析

Mysql database basic operation DQL basic query

Xcode Revoke certificate
随机推荐
Laravel 中config的用法
Unity3D_ Class fishing project, control the distance between collision walls to adapt to different models
Mysql database basic operation DQL basic query
Bidding announcement: Fujian Rural Credit Union database audit system procurement project (re bidding)
What else can an ordinary person do besides working in a factory to make money?
招标公告:福建省农村信用社联合社数据库审计系统采购项目(重新招标)
[excelexport], Excel to Lua, JSON, XML development tool
Unity的三种单例模式(饿汉,懒汉,MonoBehaviour)
Laravel5.1 路由 -路由分组
Limit of total fields [1000] in index has been exceeded
Detailed explanation of several ideas for implementing timed tasks in PHP
分步式監控平臺zabbix
47_ Contour lookup in opencv cv:: findcontours()
Rongyun won the 2022 China Xinchuang digital office portal excellence product award!
[hcsd celebrity live broadcast] teach the interview tips of big companies in person - brief notes
laravel怎么获取到public路径
JS modularization
Laravel service provider instance tutorial - create a service provider test instance
47_Opencv中的轮廓查找 cv::findContours()
three.js打造酷炫下雪效果