Question: I want to redirect user to profile page when they log in. But, it directs the to home ('/') page. Sometimes, it works if I open it in incognito mode. but not every time.

Following is my Login controller

```
class LoginController extends Controller
{  

    use AuthenticatesUsers;

    protected function redirectTo()
    {
        return '/profile';
    }

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct(Request $request)
    {
        if($email = $request->user) {

            $user = User::where('email', $email)->first();

            if($user && $user->auto_login_key == $request->key) {
                Auth::loginUsingId($user->id);
            } else {
                Redirect::to('/login')->send();
            }
        }

        $this->middleware('guest')->except('logout');
    }
}

```

And this is my Redirected authenticated miidleware

```
class RedirectIfAuthenticated
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @param  string|null  $guard
     * @return mixed
     */
    public function handle($request, Closure $next, $guard = null)
    {
        if (Auth::guard($guard)->check()) {
            return redirect('/profile');
        }

        return $next($request);
    }
}

```

Answer: 
You can use `return redirect('/profile');` inside your authentication function, for exmaple:

```
    public function __construct(Request $request)
{
    if($email = $request->user) {

        $user = User::where('email', $email)->first();

        if($user && $user->auto_login_key == $request->key) {
            Auth::loginUsingId($user->id);
            return redirect('/profile');
        } else {
            Redirect::to('/login')->send();
        }
    }

    $this->middleware('guest')->except('logout');
}

```
AS i understand your problem, you have to first clear cache after that type of changes and make sure your browser cache is clear.

```
 return redirect('/profile');

```