Answers.Body: <p>As Coleman's answer suggests, the most common cause for this I've seen is a mismatch between the URLs CiviCRM is configured to use and the ones it actually uses.</p>
  
  <p>Other places to check are -</p>
  
  <ul>
  <li>your webserver configuration (eg a canonical URL redirect) </li>
  <li>the <code>CIVICRM_UF_BASEURL</code> constant in <code>civicrm.settings.php</code></li>
  <li><strong>Administer > System Settings > Resource urls</strong> as Coleman mentions</li>
  </ul>
  
  <p>If your site DB has been migrated to your VM, you may also need to follow the steps in <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location" rel="nofollow">Moving an existing CiviCRM installation</a>.</p>
  
  <p>If these various settings don't match, CiviCRM doesn't recognise / receive its session identifiers, and the result is this confusing (and often reported) error message.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-01T00:44:58.920Z
Answers.Text: I think we could learn from our various host CMS engines and move towards reducing some of these hardcoded configurations - they seem to cause a fair amount of confusion amongst site owners.
Answers.UserDisplayName: Chris Burgess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-01T00:41:35.470Z
Answers.LastActivityDate: 2015-06-01T00:49:55.227Z
Answers.LastEditDate: 2015-06-01T00:49:55.227Z
Answers.UserDisplayName: Chris Burgess
Answers.Body: <p>We experienced this issue today on our Wordpress installation of CiviCRM. The Apache/PHP Error log had the following output:</p>
  
  <pre><code>AH01071: Got error 'PHP message: PHP Warning:  session_start(): 
  open(/var/lib/php/fpm/session/sess_f8fpr0iq1oclh7i6uun8bu3vd0, O_RDWR) 
  failed: Permission denied (13) in /data/vhosts/ourwebsitedomain.org.uk/wp- 
  content/plugins/civicrm/civicrm.php on line 305
  
  PHP message: PHP Warning:  Unknown: 
  open(/var/lib/php/fpm/session/sess_f8fpr0iq1oclh7i6uun8bu3vd0, O_RDWR) 
  failed: Permission denied (13) in Unknown on line 0\nPHP message: PHP 
  Warning:  Unknown: Failed to write session data (files). Please verify that 
  the current setting of session.save_path is correct 
  (/var/lib/php/fpm/session) in Unknown on line 0'
  </code></pre>
  
  <p>In our case, our server provider (Rackspace) found that a recent automated update of either our PHP or Apache packages caused a change of ownership for a couple of php-fpm related directories from 'apache' to 'root'. Once this change of ownership was rectified the problem disappeared.</p>
  
  <p>These directories in our case were:</p>
  
  <p>/var/lib/php/fpm</p>
  
  <p>/var/lib/php/fpm/session</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-20T16:41:22.353Z
Answers.LastActivityDate: 2018-04-20T16:41:22.353Z
Answers.UserDisplayName: William Gordon
Answers.Body: <p>Please ensure you have correctly configured <strong>Administer > System Settings > Resource urls</strong>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-01T00:12:16.357Z
Answers.LastActivityDate: 2015-06-01T00:12:16.357Z
Answers.UserDisplayName: Coleman
Answers.Body: <p>This error has a multitude of causes, and is often (not always) unrelated to session keys and cookies.</p>
  
  <p>A cause of this problem I haven't seen mentioned on other Stack Exchange questions (<a href="https://civicrm.stackexchange.com/questions/14377/this-page-requires-cookies-to-be-enabled">1</a>, <a href="https://civicrm.stackexchange.com/questions/17443/all-contribution-pages-result-in-your-browser-session-has-expired-could-not-f">2</a>, <a href="https://civicrm.stackexchange.com/questions/8591/session-key-issues-after-upgrading-from-4-4-to-4-6">3</a>, <a href="https://civicrm.stackexchange.com/questions/8243/error-could-not-find-a-valid-session-key-on-contribution-payment-page-in-word">4</a>) is that this occurs when your forms allow file uploads, and those file uploads exceed the <code>upload_max_filesize</code>/<code>post_max_size</code> defined in your <code>php.ini</code> file.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-22T17:27:25.497Z
Answers.LastActivityDate: 2018-05-22T17:27:25.497Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>When I try to save any form in the CiviCRM admin area, I get this error:</p>
  
  <pre><code>Sorry but we are not able to provide this at the moment.
  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 adminstrator for assistance.
  
  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.
  
  Error type: Could not find a valid session key.
  </code></pre>
  
  <p>I have rebuilt my VM multiple times, and I'm fairly sure this has nothing to do with the cookie being set on the wrong domain.</p>
  
  <p>What am I doing wrong? I hope this is me doing something stupid and not an actual bug, but I made a JIRA issue anyway: <a href="https://issues.civicrm.org/jira/browse/CRM-16508" rel="nofollow noreferrer">CRM-16508</a>.</p>
  
  <p>I have tracked the error message to <a href="https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Controller.php" rel="nofollow noreferrer">this file</a>, if that helps.</p>
  
  <p><sub>I am aware of <a href="https://civicrm.stackexchange.com/q/2046/260">this related question</a>, but I am positive I'm not swapping between HTTP and HTTPS (I use <a href="https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security" rel="nofollow noreferrer">HSTS</a>) and I can't actually change any settings in the admin area anyway.</sub></p>
  
Tags: <wordpress>
Title: "Could not find a valid session key." Unable to save any admin forms
ThreadText: # "Could not find a valid session key." Unable to save any admin forms
  
  (Asked by: username_0 on 2015-05-17)
  
  When I try to save any form in the CiviCRM admin area, I get this error:
  
  ```
  Sorry but we are not able to provide this at the moment.
  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 adminstrator for assistance.
  
  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.
  
  Error type: Could not find a valid session key.
  
  ```
  
  I have rebuilt my VM multiple times, and I'm fairly sure this has nothing to do with the cookie being set on the wrong domain.
  
  What am I doing wrong? I hope this is me doing something stupid and not an actual bug, but I made a JIRA issue anyway: [CRM-16508](https://issues.civicrm.org/jira/browse/CRM-16508).
  
  I have tracked the error message to [this file](https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Controller.php), if that helps.
  
  I am aware of [this related question](https://civicrm.stackexchange.com/q/2046/260), but I am positive I'm not swapping between HTTP and HTTPS (I use [HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security)) and I can't actually change any settings in the admin area anyway.
  
  **Tags:** wordpress
  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_1 on 2015-06-01. Score: 4
  
  As username_3's answer suggests, the most common cause for this I've seen is a mismatch between the URLs CiviCRM is configured to use and the ones it actually uses.
  
  Other places to check are -
  
  * your webserver configuration (eg a canonical URL redirect)
  * the `CIVICRM_UF_BASEURL` constant in `civicrm.settings.php`
  * **Administer > System Settings > Resource urls** as username_3 mentions
  
  If your site DB has been migrated to your VM, you may also need to follow the steps in [Moving an existing CiviCRM installation](http://wiki.civicrm.org/confluence/display/CRMDOC/Moving+an+Existing+Installation+to+a+New+Server+or+Location).
  
  If these various settings don't match, CiviCRM doesn't recognise / receive its session identifiers, and the result is this confusing (and often reported) error message.
  
  > **Comments:**
  > **username_1**: I think we could learn from our various host CMS engines and move towards reducing some of these hardcoded configurations - they seem to cause a fair amount of confusion amongst site owners.  
  
  ---
  
  ### Answer by username_2 on 2018-04-20. Score: 2
  
  We experienced this issue today on our Wordpress installation of CiviCRM. The Apache/PHP Error log had the following output:
  
  ```
  AH01071: Got error 'PHP message: PHP Warning:  session_start(): 
  open(/var/lib/php/fpm/session/sess_f8fpr0iq1oclh7i6uun8bu3vd0, O_RDWR) 
  failed: Permission denied (13) in /data/vhosts/ourwebsitedomain.org.uk/wp- 
  content/plugins/civicrm/civicrm.php on line 305
  
  PHP message: PHP Warning:  Unknown: 
  open(/var/lib/php/fpm/session/sess_f8fpr0iq1oclh7i6uun8bu3vd0, O_RDWR) 
  failed: Permission denied (13) in Unknown on line 0\nPHP message: PHP 
  Warning:  Unknown: Failed to write session data (files). Please verify that 
  the current setting of session.save_path is correct 
  (/var/lib/php/fpm/session) in Unknown on line 0'
  
  ```
  
  In our case, our server provider (Rackspace) found that a recent automated update of either our PHP or Apache packages caused a change of ownership for a couple of php-fpm related directories from 'apache' to 'root'. Once this change of ownership was rectified the problem disappeared.
  
  These directories in our case were:
  
  /var/lib/php/fpm
  
  /var/lib/php/fpm/session
  
  
  ---
  
  ### Answer by username_3 on 2015-06-01. Score: 1
  
  Please ensure you have correctly configured **Administer > System Settings > Resource urls**.
  
  
  ---
  
  ### Answer by username_4 on 2018-05-22. Score: 1
  
  This error has a multitude of causes, and is often (not always) unrelated to session keys and cookies.
  
  A cause of this problem I haven't seen mentioned on other Stack Exchange questions ([1](https://civicrm.stackexchange.com/questions/14377/this-page-requires-cookies-to-be-enabled), [2](https://civicrm.stackexchange.com/questions/17443/all-contribution-pages-result-in-your-browser-session-has-expired-could-not-f), [3](https://civicrm.stackexchange.com/questions/8591/session-key-issues-after-upgrading-from-4-4-to-4-6), [4](https://civicrm.stackexchange.com/questions/8243/error-could-not-find-a-valid-session-key-on-contribution-payment-page-in-word)) is that this occurs when your forms allow file uploads, and those file uploads exceed the `upload_max_filesize`/`post_max_size` defined in your `php.ini` file.
  
  
  ---
  
  