[英]What is the use of laravel remember me token?
I have a couple of problems with understanding Laravel remember me functionality. 我有一些理解Laravel的问题,记住我的功能。
remember_me
column in users
table ? users
表中记住我的功能和remember_me
列之间的联系是什么? Thank you. 谢谢。
Laravel authentication offers remember me functionality out of the box. Laravel身份验证提供了开箱即用的功能。
In order to use it you need to do 2 things: 为了使用它,你需要做两件事:
add remember_token column in your users table - this is where the token will be stored pass true as a second parameter of Auth::attempt() to enable remember me behaviour If you do this, Laravel will generate a token that will be saved in users table and in a cookie. 在users表中添加remember_token列 - 这是存储令牌的位置,将其作为Auth :: attempt()的第二个参数传递,以便记住我的行为如果这样做,Laravel将生成一个将保存在用户中的令牌桌子和饼干。 On subsequent requests, even if session cookie is not available, user will be authenticated automatically as long as remember-me cookie is there.
在后续请求中,即使会话cookie不可用,只要记住我的cookie,用户就会自动进行身份验证。
You can find more details and example in the docs: Click Here 您可以在文档中找到更多详细信息和示例: 单击此处
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.