Laravel's users table has a remember_token field, what is its role?
PHP中文网
PHP中文网 2017-05-16 16:50:32
0
2
593

Laravel's users table has a remember_token field. What is its function?

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
Peter_Zhu

That is, when the user logs in, for example, there is

账号 <inout type="text" name="username">
密码 <inout type="password" name="password">
<input type="checkbox" value="1" name="remember_me" > 保存登录

When "Save Login" is selected, according to the Login interface below, you can remember_tokensave a random Token in Cookie and database users. You do not need to re-enter your account and password to log in for a period of time in the future.

Login interface

Auth::guard()->attempt(['username' => 'admin', 'password' => '123456'], $request->input('remember_me')); //第二个参数TRUE则保存

Determine whether the user is logged in (including remember_me)

Auth::guard()->check();

Please check (laravel 5.3) for details

.\vendor\laravel\framework\src\Illuminate\Auth\Guard.php
洪涛

Doesn’t that literally mean “remember me”…

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template