1

I'm using Laravel 5.5. Everything was working fine until I installed SSL on my website. Now Forms are not working properly. I have CSRF function inside my forms But after submitting form it says:
The page has expired due to inactivity. Please refresh and try again.
The weird thing is that Search form which is located in the header works fine. But forms in website pages are not working.

Any idea?
UPDATE: Search form in the header is using GET method. That's why its working!

Ali Rezaei
  • 113
  • 1
  • 2
  • 9

3 Answers3

0

This could be an interesting idea. But can you add a csrf token to the head section?

<meta name="csrf-token" content="{{ csrf_token() }}">

Just give it a try.

Ali Özen
  • 1,525
  • 2
  • 14
  • 29
0

I think the value is not passing threw your form, Verify it in networking <- inside Inspect . Also try this inside your form

<input type="hidden" name="_token" value="{{ csrf_token() }}">

I hope it works

Try this Laravel 5.5 The page has expired due to inactivity error while sending form

  • try this https://stackoverflow.com/questions/46551940/laravel-5-5-the-page-has-expired-due-to-inactivity-error-while-sending-form – M.femin Albert Apr 10 '18 at 07:09
0

You wouldn't believe me . The problem was because of this code in htaccess file
<filesMatch ".(css|jpg|jpeg|png|gif|js|ico)$"> Header set Cache-Control "max-age=2592000, public" </filesMatch>
I removed it and the problem is gone! Thanks everybody.

Ali Rezaei
  • 113
  • 1
  • 2
  • 9