How to set session expiration time in laravel
阿神
阿神 2017-05-16 16:48:16
0
1
904

$request->session()->put('code',$code);

How to set the expiration time when creating a session

'lifetime' => 120,

Are there any other setting methods besides this setting?

阿神
阿神

闭关修行中......

reply all(1)
某草草

I guess you want to set a longer time for some values, right.

Then you should use cache来做哦,Session的初衷就是保存用户会话的东西,一般也只保存登录用户的一些信息。
只要用户在有效期内持续访问,Sessionit will automatically extend

For example, the Cache key name is: user-12-some

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!