Answers.Body: <p>Are you by any chance using a caching plugin or extension? We had this error on event registrations and had to exclude the event pages from being cached. That resolved the issue.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-12T06:22:28.867Z
Answers.LastActivityDate: 2020-03-12T06:22:28.867Z
Answers.UserDisplayName: dik hoogmoed
Body: <p>Currently on:
  Wordpress 4.7.2
  CiviCRM 4.7.16</p>
  
  <p>As I am making changes here and there on this clean Civi install with a migrated database, I noticed when submitting all contribution pages result in,</p>
  
  <blockquote>
    <p>"Your browser session has expired and we are unable to complete your
    form submission. We have returned you to the initial step so you can
    complete and resubmit the form. If you experience continued
    difficulties, please contact us for assistance."</p>
  </blockquote>
  
  <p>I believe the follow section of the civicrm log is relevant,</p>
  
  <pre><code>[info] $Fatal Error Details = Array
  (
      [message] =&gt; We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site administrator for assistance.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example.org or a domain alias like http://myotherexample.org.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;Error type: Could not find a valid session key.
      [code] =&gt; 
  )
  [info] $backTrace = #0 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(373): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(833): CRM_Core_Error::fatal("We can't load the requested web page. This page requires cookies to be enable...")
  #2 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(828): CRM_Core_Controller-&gt;invalidKeyCommon()
  #3 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(312): CRM_Core_Controller-&gt;invalidKey()
  #4 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(204): CRM_Core_Controller-&gt;key("CRM_Contribute_Form_ContributionPage_Settings", TRUE, FALSE)
  #5 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller/Simple.php(66): CRM_Core_Controller-&gt;__construct("Title and Settings", TRUE, NULL, "CRM_Contribute_Form_ContributionPage_Settings", FALSE, FALSE)
  #6 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php(84): CRM_Core_Controller_Simple-&gt;__construct("CRM_Contribute_Form_ContributionPage_Settings", "Title and Settings", NULL, FALSE, FALSE, FALSE, FALSE)
  #7 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(284): CRM_Utils_Wrapper-&gt;run("CRM_Contribute_Form_ContributionPage_Settings", "Title and Settings", NULL)
  #8 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
  #9 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
  #10 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm.php(1227): CRM_Core_Invoke::invoke((Array:4))
  #11 [internal function](): CiviCRM_For_WordPress-&gt;invoke("")
  #12 /home/yoursbaa/public_html/tbe/wp-includes/class-wp-hook.php(298): call_user_func_array((Array:2), (Array:1))
  #13 /home/yoursbaa/public_html/tbe/wp-includes/class-wp-hook.php(323): WP_Hook-&gt;apply_filters("", (Array:1))
  #14 /home/yoursbaa/public_html/tbe/wp-includes/plugin.php(453): WP_Hook-&gt;do_action((Array:1))
  #15 /home/yoursbaa/public_html/tbe/wp-admin/admin.php(222): do_action("toplevel_page_CiviCRM")
  #16 {main}
  </code></pre>
  
  <p>I have tried clearing the browser's cookies, using a different browser, and a different WordPress account. No luck.</p>
  
  <p>One old forum post mentioned changes in URLs when loading the next page. I don't know how to test. I can tell you the URLS are the same when the pages load, and the URLs in Civi settings and Wordpress are the same absolute URL.</p>
  
  <p>I checked all URLs in</p>
  
  <ul>
  <li>WP's Settings - General</li>
  <li>Civi's Settings - Resource URLs</li>
  <li>Civi's civicrm.settings.php</li>
  </ul>
  
  <p>They all match: <code>https://yourshulbythesea.org/tbe/</code></p>
  
  <p>I've had issues with SSL when installing Civi, so I tried submiting a form with disabled HTTPS (no luck):</p>
  
  <ul>
  <li>Turned off Civi's force HTTPS</li>
  <li>Disabled <a href="https://wordpress.org/plugins/wp-force-https/" rel="nofollow noreferrer">WordPress Force HTTPS</a> plugin</li>
  <li>Edited the WP URL settings to be standard HTTP.</li>
  </ul>
  
  <p>Note that this is a migrated site. The original 'staging' one doesn't have this issue. <strong>The change in URL was from <code>subdomain.website.com/</code> to <code>website.com/subfolder/</code></strong></p>
  
  <p>I've run some search/replaces on the changes. A double check since this issue gives no results for the former URL. Is it possible a Civi setting didn't add the new subfolder to URLs?</p>
  
  <p>Maybe something isn't properly configured for the change in URL? How can I troubleshoot this further? Thanks.</p>
  
  <p><em>Edited to add more details.</em></p>
  
  <p><em>Edit: I've made a second migration of the WordPress site to the root folder.</em> <strong>The error is now gone, which makes me speculate that the error has to do with the CiviCRM database retaining the original URL without a subfolder or subdomain</strong> (despite CiviCRM's directory settings saying the correct path). If true, this may be two things:
   - My initial migration/SQL replace efforts made a mistake and edited a URL improperly.
   - CiviCRM has made editing URLs for certain tasks like contributions not accessible through the directory settings/migration.</p>
  
  <p>I believe it's the former. I likely made an error myself, as opposed to CiviCRM never having a reported instance of migration over subdomain/subfolder breaking contributions.</p>
  
Tags: <wordpress><contributions><contribution-page><migration>
Title: All Contribution pages result in "Your browser session has expired" "Could not find a valid session key"
ThreadText: # All Contribution pages result in "Your browser session has expired" "Could not find a valid session key"
  
  (Asked by: username_0 on 2017-02-28)
  
  Currently on:
  Wordpress 4.7.2
  CiviCRM 4.7.16
  
  As I am making changes here and there on this clean Civi install with a migrated database, I noticed when submitting all contribution pages result in,
  
  > "Your browser session has expired and we are unable to complete your
  > form submission. We have returned you to the initial step so you can
  > complete and resubmit the form. If you experience continued
  > difficulties, please contact us for assistance."
  
  I believe the follow section of the civicrm log is relevant,
  
  ```
  [info] $Fatal Error Details = Array
  (
      [message] => We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are not enabled). Then try again. If this error persists, contact the site administrator for assistance.&lt;br /&gt;&lt;br /&gt;Site Administrators: This error may indicate that users are accessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example.org or a domain alias like http://myotherexample.org.&lt;br /&gt;&lt;br /&gt;Error type: Could not find a valid session key.
      [code] => 
  )
  [info] $backTrace = #0 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(373): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(833): CRM_Core_Error::fatal("We can't load the requested web page. This page requires cookies to be enable...")
  #2 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(828): CRM_Core_Controller->invalidKeyCommon()
  #3 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(312): CRM_Core_Controller->invalidKey()
  #4 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(204): CRM_Core_Controller->key("CRM_Contribute_Form_ContributionPage_Settings", TRUE, FALSE)
  #5 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller/Simple.php(66): CRM_Core_Controller->__construct("Title and Settings", TRUE, NULL, "CRM_Contribute_Form_ContributionPage_Settings", FALSE, FALSE)
  #6 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php(84): CRM_Core_Controller_Simple->__construct("CRM_Contribute_Form_ContributionPage_Settings", "Title and Settings", NULL, FALSE, FALSE, FALSE, FALSE)
  #7 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(284): CRM_Utils_Wrapper->run("CRM_Contribute_Form_ContributionPage_Settings", "Title and Settings", NULL)
  #8 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
  #9 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
  #10 /home/yoursbaa/public_html/tbe/wp-content/plugins/civicrm/civicrm.php(1227): CRM_Core_Invoke::invoke((Array:4))
  #11 [internal function](): CiviCRM_For_WordPress->invoke("")
  #12 /home/yoursbaa/public_html/tbe/wp-includes/class-wp-hook.php(298): call_user_func_array((Array:2), (Array:1))
  #13 /home/yoursbaa/public_html/tbe/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters("", (Array:1))
  #14 /home/yoursbaa/public_html/tbe/wp-includes/plugin.php(453): WP_Hook->do_action((Array:1))
  #15 /home/yoursbaa/public_html/tbe/wp-admin/admin.php(222): do_action("toplevel_page_CiviCRM")
  #16 {main}
  
  ```
  
  I have tried clearing the browser's cookies, using a different browser, and a different WordPress account. No luck.
  
  One old forum post mentioned changes in URLs when loading the next page. I don't know how to test. I can tell you the URLS are the same when the pages load, and the URLs in Civi settings and Wordpress are the same absolute URL.
  
  I checked all URLs in
  
  * WP's Settings - General
  * Civi's Settings - Resource URLs
  * Civi's civicrm.settings.php
  
  They all match: `https://yourshulbythesea.org/tbe/`
  
  I've had issues with SSL when installing Civi, so I tried submiting a form with disabled HTTPS (no luck):
  
  * Turned off Civi's force HTTPS
  * Disabled [WordPress Force HTTPS](https://wordpress.org/plugins/wp-force-https/) plugin
  * Edited the WP URL settings to be standard HTTP.
  
  Note that this is a migrated site. The original 'staging' one doesn't have this issue. **The change in URL was from `subdomain.website.com/` to `website.com/subfolder/`**
  
  I've run some search/replaces on the changes. A double check since this issue gives no results for the former URL. Is it possible a Civi setting didn't add the new subfolder to URLs?
  
  Maybe something isn't properly configured for the change in URL? How can I troubleshoot this further? Thanks.
  
  *Edited to add more details.*
  
  *Edit: I've made a second migration of the WordPress site to the root folder.* **The error is now gone, which makes me speculate that the error has to do with the CiviCRM database retaining the original URL without a subfolder or subdomain** (despite CiviCRM's directory settings saying the correct path). If true, this may be two things:
  - My initial migration/SQL replace efforts made a mistake and edited a URL improperly.
  - CiviCRM has made editing URLs for certain tasks like contributions not accessible through the directory settings/migration.
  
  I believe it's the former. I likely made an error myself, as opposed to CiviCRM never having a reported instance of migration over subdomain/subfolder breaking contributions.
  
  **Tags:** wordpress, contributions, contribution-page, migration
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-03-12. Score: 3
  
  Are you by any chance using a caching plugin or extension? We had this error on event registrations and had to exclude the event pages from being cached. That resolved the issue.
  
  
  ---
  
  