1

I'am using laravel 5.5 and it gives me that "The page has expired due to inactivity. Please refresh and try again." This is awkward because I never encounter this error. Same codes but different laravel version..

My form;

{!! Form::open(['url'=>'admin/save-social']) !!}
{{ Form::label('pinterest', 'Pinterest;', ['class' => 'control-label']) }}
{{ Form::text('pinterest', null, ['class' => 'form-control'])}}
{{ Form::label('linkedn', 'Linkedn;', ['class' => 'control-label'])}}
{{ Form::text('linkedn', null, ['class' => 'form-control'])}}
{{ Form::label('facebook', 'Facebook;', ['class' => 'control-label']) }}
{{ Form::text('facebook', null, ['class' => 'form-control']) }}
{{ Form::label('twitter', 'Twitter;', ['class' => 'control-label']) }}
{{ Form::text('twitter', null, ['class' => 'form-control']) }}
{{ Form::label('instagram', 'İnstagram;', ['class' => 'control-label']) }}
{{ Form::text('instagram', null, ['class' => 'form-control']) }}
{{ Form::submit('Save', ['class'=>'btn btn-success btn-lg btn-block']) }}
{!! Form::close()!!}

And config/session.php

<?php

return [
    'driver' => env('SESSION_DRIVER', 'file'),
    'lifetime' => 120,
    'expire_on_close' => false,
    'encrypt' => false,
    'files' => storage_path('framework/sessions'),
    'connection' => null,
    'table' => 'sessions',
    'store' => null,
    'lottery' => [2, 100],
    'cookie' => env(
        'SESSION_COOKIE',
        str_slug(env('APP_NAME', 'laravel'), '_').'_session'
    ),
    'path' => '/',
    'domain' => env('SESSION_DOMAIN', null),
    'secure' => env('SESSION_SECURE_COOKIE', false),
    'http_only' => true,
    'same_site' => null,
];

4 Answers4

4

Since these commands has solved your problem in the comments i should write it as an answer . Try these commands and start your form again

 php artisan cache:clear
 php artisan config:clear 
 php artisan route:clear 
 php artisan view:clear
wahdan
  • 1,208
  • 3
  • 16
  • 26
0

I assume that you are using laravel collective for forms builder.

Probably your issue is associate with CSRF Protection (https://laravelcollective.com/docs/master/html#csrf-protection).

Please check the above link and ensure that you include CSRF based on method or explicit Form::token();

  • Another point is that Laravelcollective maybe not is available for laravel 5.5. You can check this issue from GitHub and find a workaround for collective in Laravel 5.5 https://github.com/LaravelCollective/html/issues/364 – Joaquin Lozano Cifuentes Oct 04 '17 at 04:40
0

Another point is that Laravelcollective maybe not is available for laravel 5.5. You can check this issue from GitHub and find a workaround for collective in Laravel 5.5 https://github.com/LaravelCollective/html/issues/364

0

Try out the following statements:

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

It worked for me. Enjoy