ang*_*000 5 authentication laravel
I have a question about the default Laravel Remember Me option below the login form. I use the default built-in LoginController.
When I read the Laravel documentation, then I read about the Remember option:
"which will keep the user authenticated indefinitely, or until they manually logout"
Ok. Now I do a test:
这怎么可能?有什么不同?
如果你使用“记住我”,Laravel 会放置带有令牌的 cookie,用于在你下次访问该页面时让你登录(如果你以某种方式注销,我将在稍后解释)。
Laravel 默认情况下使用有效期为 2 小时的会话(您可以在配置中进行设置),因此如果您在登录时关闭浏览器,然后尝试在 2 小时的窗口中再次打开同一浏览器,服务器将不会注意到更改。
“以某种方式退出”
回答你的问题“有什么区别?”:
如果您使用“记住我”,Laravel 将在登录时使用令牌设置 cookie,而不是凭据(名称:密码组合),并且该过程对用户不可见。
如果您不使用记住我,您只能登录 2 小时(或配置文件中设置的任何内容),无需执行任何操作。浏览器即使在关闭后仍保留会话信息的事实被认为是浏览器的功能)。