Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

karimsamir's avatar

Laravel 4 TokenMismatchException error when login or signup

I have a problem with login and signup in L4 page, the project works fine in my local machine. but in the production server when i try to login i get the following error

Illuminate \ Session \ TokenMismatchException

Route::filter('csrf', function()
{
    if (Session::token() != Input::get('_token'))
    {
        throw new Illuminate\Session\TokenMismatchException;

    }

the login and signup works fine before one day but now i get this error. I do not now why, I used the default session driver which is a file driver. and have write permission on the storage/session folder I try many solutions without any success.

Thanks

0 likes
2 replies
Mehdi_Souihed's avatar

Are you sure that

Input::get('_token')

is not empty ?

If it is not I would suggest clearing all your caches.

bobbybouwmann's avatar

Are you sure you have the hidden input field with the name _token in your form?

Please or to participate in this conversation.