Search code examples
sessionlaravel-5.3token

Laravel 5.3 session cookies are not creating in browser


I am facing token mismatch issue in new server while working fine in localhost. I have tried every possible way to clear cache and give SESSION_DOMAIN path in env but all seems useless.

Also session cookies are not being created in web browser while creating in storage/framework/session folder.

Please help me !


Solution

  • Are you getting tokenMismatchException exception?

    If yes, some of the possible reasons are:

    1. Check your files for PHP end tag "?>", if exists remove it. For more detail refer to this link.

    2. You may need to use web middleware. For more detail refer to this link (although it is about laravel 5.2 but, it may work for your situation too).