mardi 19 février 2019

How to fix Auth:attempt() not persisting after page redirect?

Im deploying my laravel app developed on windows to my godaddy server (linux) everything is working great. except for authentication. i implement my own authcontroller

public function doLogin(Request $request){
    $credentials = $request->only('email', 'password');

    if (Auth::attempt($credentials)) {
       return redirect()->intended('/');
    }

    return back()->with('status','fail');
}

i am certain Auth::attempt returns true and when i return Auth::user(). i can get the user detail. but after redirecting. the Auth details disappear. everything works great on my localhost



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire