0

Same question already has been ask here, and I have tried everything read.

My old question reference Laravel 5.5 The page has expired due to inactivity token is present

I have tried: "The page has expired due to inactivity" - Laravel 5.5 https://www.5balloons.info/fixed-page-expired-due-inactivity-laravel-5/

I have tried file and database both for cache and session, all of my forms has TOKEN.

Permissions on storage

 drwxrwxrwx  5 ABC ABC   4096 May 30 23:16 storage

My .env file

APP_NAME="Name"
APP_ENV=staging
APP_KEY=SOMEKEY
APP_DEBUG=false
APP_LOG_LEVEL=false
APP_URL=http://url

DB_CONNECTION=mysql
DB_HOST=mysql.host.com
DB_PORT=3306
DB_DATABASE=db_name
DB_USERNAME=db_user
DB_PASSWORD=db_user_password

BROADCAST_DRIVER=log
CACHE_DRIVER=database
SESSION_DRIVER=database
QUEUE_DRIVER=sync

Form

<form class="form-horizontal" method="POST" action="{{ route('password.request') }}">
        {{ csrf_field() }}

        <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">

            <div class="col-md-12">
                <label for="email" class="control-label">E-Mail Address</label>
                <input id="email" type="email" class="form-control" name="email" value="{{ $email or old('email') }}" required autofocus>

                @if ($errors->has('email'))
                    <span class="help-block">
                                    <strong>{{ $errors->first('email') }}</strong>
                                </span>
                @endif
            </div>
        </div>

What am I missing here, no idea.

danyal14
  • 367
  • 1
  • 4
  • 18

1 Answers1

1

Try to do these :

php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan config:cache

And in controller constructor try to flush the session because this csrf_token is stored in the session per user.

public function __construct()
{
    Session::flush();
}

Session::regenerateToken(); // Which generates a new token on request.

And you can try this also :

<input type="hidden" name="_token" value="{{{ csrf_token() }}}" />
Fahim Uddin
  • 681
  • 2
  • 10
  • 36