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

Leave a Reply

Your email address will not be published.