I'm working on a Laravel project and I'm currently trying to implement a method for users logging in. I read on the documentation that Auth::attempt()
's second param is a bool $remember
which defaults to false
.
I have no settings for the second param so I assume when exiting my browser completely, I should be logged out. This is not the case. I seem to have the same functionality regardless of my bool $remember
param's setting of true
or false
.
if (Auth::attempt(array(
'email' => Input::get('email'),
'password' => Input::get('password'),
'status' => 'accepted')))
{
// ... logged in
}
打开app/config/session.php
并将lifetime
设置为0。
如果要在没有会话/ cookie的情况下登录该请求的人,则应使用Auth::once($credentials)
而不是Auth::attempt($credentials)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.