1

I wanted to create a signup form and hold the session for that current user logged in. It worked perfectly yesterday, and today when I tried to signup a new user it says your session has expired please refresh and try again. I have tried almost every solution but could not solve my problem. Newbie to Laravel using v5.7.19 and PHP v7.3

welcome.blade.php

<div class="col-md-6">
    <h3>Sign Up</h3>
    <form action="{{ route('signup')}}" method="post">
        @csrf
        <div class="form-group">
            <label for="email">Your E-mail</label>
            <input class="form-control" type="text" name="email" id="email">
        </div>
        <div class="form-group">
            <label for="first_name">Your First Name</label>
            <input class="form-control" type="text" name="first_name" id="first_name">
        </div>
        <div class="form-group">
            <label for="password">Your Password</label>
            <input class="form-control" type="password" name="password" id="password">
        </div>
        <button type="submit" class="btn btn-primary">Submit</button>
        <input type="hidden" name="_token" value="{{ Session::token() }}">
    </form>
</div>

web.php

Route::group(['middleware' => ['web']], function () {
    Route::get('/', function () {
        return view('welcome');
    });
    Route::post('/signup', [
        'uses' => 'UserController@poignup',
        'as' => 'signup'
    ]);
});
Karl Hill
  • 12,937
  • 5
  • 58
  • 95
  • 2
    it would be easier to help you if you provide code inside `poignup` method. – Kyaw Kyaw Soe Jan 14 '19 at 08:23
  • Possible duplicate of [Post request in Laravel 5.7 --- Error - 419 Sorry, your session has expired](https://stackoverflow.com/questions/52583886/post-request-in-laravel-5-7-error-419-sorry-your-session-has-expired) – pr1nc3 Jan 14 '19 at 08:53

0 Answers0