I'm trying to migrate laravel from version 5.2 to 6.0 , but i have different folder for different version in same local wamp server . I'm using same database file both version . But i'm always getting csrf token mismatch and page expired . Please give me some good solutions for this.
1 Answer
This problem comes from the CSRF token verification which fails. So either you're not posting one or you're posting an incorrect one.
Use {{ csrf_field() }} in your form
OR
Add Your Route URL into the Http/Middleware/VerifyCsrfToken.php file.
Example Like this. If your ajax route Route::post('searchsubmit','User\UserController@ViewSearchList')->name('searchsubmit');
Http/Middleware/VerifyCsrfToken.php
protected $except = [
'searchsubmit',
];
In Your Case You need to add login like this
protected $except = [
'login',
];
6 Comments
lagbox
cache:clear is for flushing your cache store, it has nothing to do with the configuration or anything like thatAli
this is a good solution but i dont recommend that. you should put csrf token for all your forms. maybe php clear all config and caches help you. you can also check @csrf instead of csrf_token()
lagbox
@kerbholz finally someone else who gets that point about not needing it cached on development :) drives me crazy everytime someone says to cache it
Adil Basha
i used all above command , my problems is when another guys use same laravel project from my system in his system from networks this problems occur.
|
php artisan servein the different folders