I logged in through the Laravel authentication system and set Remember_token, After going from one link to another link (Route) The authentication system is down and I am Logout , code for login and set remember_token :
Auth::login($user,true);
I logged in through the Laravel authentication system and set Remember_token, After going from one link to another link (Route) The authentication system is down and I am Logout , code for login and set remember_token :
Auth::login($user,true);
Have used this
If you are "remembering" users, you may use the viaRemember method to determine if the user was authenticated using the "remember me" cookie
if (Auth::viaRemember()) {
//
}
Ref https://laravel.com/docs/7.x/authentication#remembering-users
Code for user registration:
$user = new user;
$user->name = $request->user;
$user->email = $request->email;
$user->password = Hash::make($request->pw);
$user->tell = $request->tell;
if($request->hometel){$user->tel_sabet = $request->hometel;}
if($request->adress){$user->adress = $request->adress;}
$user->avatar = $filepath;
if($request->codepost){$user->codepost = $request->codepost;}
$user->remember_token = $request->token;
$id = $user->id;
$ok = $user->save();
if($ok){
Auth::login($user,true);
if($request->req !=""){
return redirect('reqticher');
}else {
return redirect('/');
}