ExpressionEngine – How to Fix: “This form has expired. Please refresh and try again.”

ExpressionEngine is the bees knees. You do, however, run into the occasional hiccup. This post is about such a hiccup! (when using ExpressionEngine 2.8.1, though other versions do have the same problem)

When building a simple form contact form that submits through POST, I encountered the following error message:
“This form has expired. Please refresh and try again.”

For fun, let’s say this mockup code is what I was using:

<form method="post" id="theform">
	<input type="text" name="name" size="60">
	<input type="text" name="email" size="60">
	<textarea name="message" class="message"></textarea>
	<input type="submit" value="Send" class="button" >

Yep, a simple form. So here are some simple solutions to this problem.

Solution 1) Change “post” to “get”.

<form method="get" id="theform">

This isn’t a preferable option at all, but it’s a fast solution.

Solution 2) Add the following line to your config file.

$config['disable_csrf_protection'] = "y";

This solution works well if you don’t care about the csrf protection.

Hope it helps!

Incoming search terms:

  • yhs-fullyhosted_003
  • spotify this form has expired
  • This form has expired Please reload the page and try again
  • expression engine this form has expired please refresh and try again
  • https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1827 _IfSMByRfl-b4UGFpfZmBBoQryBPcjzN5ndd1JpaUoxrtZrE919c2ffX3EOmi1TG 835a36e79f070ecaed4d1f3010290e8444062ae8&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme
  • https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1829 DyLfqcBWzgPXRdnqrytTsSfSdXSYpEV4VEx4ustn5EoB5zsCHG38M5CBEvLCCsEV 998f2634a976545cff454c5559c5c1538741028f&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme
  • https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1832 0ruJHCPDqfavzEW2TsXS448D05-lHJQRT0Xd7F2fyBznq3daXZ-qSXvBBYcRwnYr 0c7a99c0c6587276269d7068c0a938e13b9b0409&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme
  • J2EZ
  • pondmvv

Leave a Reply

Your email address will not be published.