Initially my laravel application was working on HTTP protocol, Then I changed the protocol to HTTPS.
Unfortunately now my application's login is not working now.it shows me 419 error, Sorry Your session expired. I tried couple of solutions suggested.
https://laracasts.com/discuss/channels/laravel/post-request-in-laravel-57-error-419-sorry-your-session-has-expired.
Laravel 419 Error - VerifyCsrfToken issue
Post request in Laravel 5.7 --- Error - 419 Sorry, your session has expired.
But none of these solved my issue.
I am using CRUDBOOSTER plugin to manage login.
Routes.php.
/* ROUTER FOR WEB */
Route::group(['middleware' => ['web'], 'prefix' => config('crudbooster.ADMIN_PATH'), 'namespace' => $namespace], function () {
Route::post('unlock-screen', ['uses' => 'AdminController@postUnlockScreen', 'as' => 'postUnlockScreen']);
Route::get('lock-screen', ['uses' => 'AdminController@getLockscreen', 'as' => 'getLockScreen']);
Route::post('forgot', ['uses' => 'AdminController@postForgot', 'as' => 'postForgot']);
Route::get('forgot', ['uses' => 'AdminController@getForgot', 'as' => 'getForgot']);
Route::post('register', ['uses' => 'AdminController@postRegister', 'as' => 'postRegister']);
Route::get('register', ['uses' => 'AdminController@getRegister', 'as' => 'getRegister']);
Route::get('logout', ['uses' => 'AdminController@getLogout', 'as' => 'getLogout']);
Route::post('login', ['uses' => 'AdminController@postLogin', 'as' => 'postLogin']);
Route::get('login', ['uses' => 'AdminController@getLogin', 'as' => 'getLogin']);
});
My Form
<form autocomplete='off' action="{{ route('postLogin') }}" method="post">
@csrf
<!-- <input type="hidden" name="_token" value="{{ csrf_token() }}"/> -->
<div class="form-group has-feedback">
<input autocomplete='off' type="text" class="form-control" name='email' required placeholder="Email"/>
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input autocomplete='off' type="password" class="form-control" name='password' required placeholder="Password"/>
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div style="margin-bottom:10px" class='row'>
<div class='col-xs-12'>
<button type="submit" class="btn btn-primary btn-block btn-flat"><i class='fa fa-lock'></i> {{trans("crudbooster.button_sign_in")}}</button>
</div>
</div>
<div class='row'>
<div class='col-xs-12' align="center"><p style="padding:10px 0px 10px 0px">{{trans("crudbooster.text_forgot_password")}} <a
href='{{route("getForgot")}}'>{{trans("crudbooster.click_here")}}</a></p></div>
</div>
</form>.
And I attaching my error screen.
can any one help me rid this issue.
If you can see the hidden CSRF HTML input field, clear the cached data:
php artisan cache:clear
php artisan view:clear
and regenerate a new key:
php artisan key:generate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With