[email protected]
4 years ago

CSRF Token Mismatch when moved to new server

Posted 4 years ago by [email protected]

I started a project on my local machine. I am able to login fine there. I do have the {{csrf_field()}} inside my login form.

I set up a remote server for testing and I am getting this error when logging in.

TokenMismatchException in VerifyCsrfToken.php line 67:

in VerifyCsrfToken.php line 67
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124

The project run's fine on mine and another developer's machine. The only difference is our servers are windows and the test server is linux. Any ideas on what could be happening?

I am using the out of the box login. This declaration is in the web middleware Route::auth();

Please sign in or create an account to participate in this conversation.