We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

EE 3.4.2, Forms and "This form has expired. Please refresh and try again." woes

Development and Programming

NMG's avatar
NMG
7 posts
8 years ago
NMG's avatar NMG

Hello World:

I am at the edge of my seat, filled with frustration of not knowing if the issue is with EE or with the form submission Add-on.

I am reaching out to those who have a working form, perhaps even mailchimp working on their EE installation.

  • EE 3.4.2
  • Solspace Freeform 5.0.5 (free version)
  • Subscriber EE Add-on

Either Freeform or Subscriber give me an error of

“

This form has expired. Please refresh and try again.

“

This leads me to believe it is an EE issue.

Any help, extremely appreciated,

Thank you.

       
Pedro Guimaraes's avatar
Pedro Guimaraes
170 posts
8 years ago
Pedro Guimaraes's avatar Pedro Guimaraes

EE has CSRF protection which means that forms expire after 2 hours.

If you’re seeing this issue right after a page loads, there are several possibilities. Some are:

  • Incorrect server/EE timezone settings (very likely)
  • You’re loading www.domain.com and the form is posting to domain.com
  • .htaccess issue
       
NMG's avatar
NMG
7 posts
8 years ago
NMG's avatar NMG

I tried checking the three issues you mentioned Pedro:

Incorrect server/EE timezones. I tried following some pointers into this, but I have not true idea how I can verify if both are working in sync or not. Tried running a PHP I found

<?php
global $PREFS, $SESS;
echo 'Site default time zone: '.$PREFS->ini('default_site_timezone');
echo '
Server timezone: '.$PREFS->ini('server_timezone');
echo '
User timezone: '.$SESS->userdata['timezone'];
?>

But this didn’t work, it gave me a {!-- ra:whatever --}

  1. I am working with a domain without www and it seems like everything comes that way.

  2. .htaccess issue, I am using htaccess, but everything seems to be working there, unless the mod_rewrite has to have some specific code in there.

I am totally frustrated with this issue. A simple form from solspace is not working, and I think the culprit is EE. Any other suggestion(s.)

       
NMG's avatar
NMG
7 posts
8 years ago
NMG's avatar NMG

UPDATE

The form works turning off the CSRF protection in config file.

That should not be the case.

I think it is EE settings, somewhere is not okay, because the “EE Email Contact Form” found at https://docs.expressionengine.com/latest/add-ons/email/contact_form.html also brings the frustrating message: This form has expired. Please refresh and try again.

What can be the issue? time? How can I make sure that times are okay? web is working through sessions, should it be sessions&cookies;?

$config['disable_csrf_protection'] = "y";
       
NMG's avatar
NMG
7 posts
8 years ago
NMG's avatar NMG

Frustration over, after going through all of the security settings, these should be set and required:

CP Session Type: Cookies and session ID Website Session Type: Cookies only

Domain: Exact domain. This is where .htaccess might be messy

Path: Very important if you’re using a subdirectory for EE

Now everything works.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.