TransWikia.com

This form has expired. Please refresh and try again

ExpressionEngine® Answers Asked by user2462 on October 3, 2021

I see this is a time-honored problem…

I am using Freeform 4.1.3 on EE 2.9.2. This has been a stable solution for a long time. I have changed nothing with the system. I have been successfully collecting data as recently as last week. I have created a couple of new forms that are essentially clones of forms that still work. And yet I get the dreaded error.

Have tried two browsers, one with no related history. Source code shows hidden fields for both XID and crf_token values. I have cleared the cache. I cannot turn off caching, getting the “Cannot connect to Dummy, using File driver instead” error message.

I see other threads with solutions that work some of the time for some of the people, but I hate to go twisting knobs when the current configuration has been working fine.

Any help? Simple code:

{exp:freeform:form
    form_name="council_nom"
    required="first_name|last_name|email"
    notify_user="yes" 
    user_notification_template="default" 
    user_email_field="email"
    notify_admin="yes" 
    admin_notification_template="default_template" 
    admin_notify="[email protected]" 
    return="http://www.4sonline.org/prizes/carson/got_it"
}

    <h3>Nominated by</h3>
    <label>First name:  </label>
    {freeform:field:first_name}

    <label>Last name:    </label>
    {freeform:field:last_name}

    <label>Email:    </label>
    {freeform:field:email}

    <label>Institution:    </label>
    {freeform:field:institution}

    <h3>Nominee</h3>
    <label>First name</label>
    {freeform:field:nominee_first}

    <label>Last name:    </label>
    {freeform:field:nominee_last}

    <label>Email:    </label>
    {freeform:field:nominee_email}

    <label>Institution:    </label>
    {freeform:field:nominee_institution}


    <label>Rationale (limit 2,000 words)</label>
    {freeform:field:rationale}


    <p>Not so fast!<br/>
      {freeform:captcha} <br>
      If you are not a robot, please type the text above into this box:
      <input type="text" name="captcha" /> <br/>
    </p>

    <p><input type="submit" name="submit" value="Submit" /></p>

{/exp:freeform:form}

2 Answers

It appears that you're using a version of Freeform that is not compatible with the version of ExpressionEngine you're using. Freeform 4.1.4 makes a compatibility update for EE 2.8+, which changed the way CSRF handling works (specifically, EE changed things from XID_TOKEN to CSRF_TOKEN).

The version of Freeform you're using is also over 4 years old. The latest version available for Freeform 4.x for EE2 is Freeform 4.2.5. I would recommend you update to this version to resolve this issue (and several other issues).

If you're using the Pro version of Freeform, you will have access to this update inside your Solspace account. If this is the free version of Freeform, you'll need to contact Solspace support for the updated version (select "Account" from the Product menu in support form).

Answered by Solspace on October 3, 2021

It looks like you are using ce_cache module. You need to escape the cache for form so it can get fresh CSRF token and XID for each refresh.

Try:

{exp:ce_cache:escape}
    {exp:freeform:form
        form_name="council_nom"
        required="first_name|last_name|email"
        notify_user="yes" 
        user_notification_template="default" 
        user_email_field="email"
        notify_admin="yes" 
        admin_notification_template="default_template" 
        admin_notify="[email protected]" 
        return="http://www.4sonline.org/prizes/carson/got_it"
    }

        <h3>Nominated by</h3>
        <label>First name:  </label>
        {freeform:field:first_name}

        <label>Last name:    </label>
        {freeform:field:last_name}

        <label>Email:    </label>
        {freeform:field:email}

        <label>Institution:    </label>
        {freeform:field:institution}

        <h3>Nominee</h3>
        <label>First name</label>
        {freeform:field:nominee_first}

        <label>Last name:    </label>
        {freeform:field:nominee_last}

        <label>Email:    </label>
        {freeform:field:nominee_email}

        <label>Institution:    </label>
        {freeform:field:nominee_institution}


        <label>Rationale (limit 2,000 words)</label>
        {freeform:field:rationale}


        <p>Not so fast!<br/>
          {freeform:captcha} <br>
          If you are not a robot, please type the text above into this box:
          <input type="text" name="captcha" /> <br/>
        </p>

        <p><input type="submit" name="submit" value="Submit" /></p>

    {/exp:freeform:form}
{/exp:ce_cache:escape}

Answered by Mufi - Amici Infotech on October 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP