Answers.Body: <p>For anyone getting this error in version 4. For me the php.ini solution also didn't work. It helped to add a key named:
  CRAFT_SECURITY_KEY='YOURKEY'
  in the .env file, replace YOURKEY with your actual SECURITY_KEY</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-06-15T08:25:17.940Z
Answers.LastActivityDate: 2024-06-15T08:26:01.870Z
Answers.LastEditDate: 2024-06-15T08:26:01.870Z
Answers.UserDisplayName: Lennie
Body: <p>For a while our Craft CMS webshop show errors in the control panel.
  This happens 25%-50% of the requests. Looking in the phperror log a lot of this errors are logged:</p>
  <p>[13-Dec-2021 23:00:05 UTC] An Error occurred while handling another error: yii\base\InvalidConfigException: craft\web\Request::cookieValidationKey must be configured with a secret key.</p>
  <p>The SECURITY_KEY is set in the .env and also in /config/general.php</p>
  <p>It seams like the server can't read or find the .env sometimes.
  Earlier i found a topic to change the php variable 'variables_order' EGPCS.
  This was not the solution for me.</p>
  <p>Anyone some tips?</p>
  <p>Craft CMS 3.7.24<br>
  PHP 7.4.26 <br>
  Hosted on Siteground</p>
  
Tags: <error><env>
Title: craft\web\Request::cookieValidationKey must be configured with a secret key
ThreadText: # craft\web\Request::cookieValidationKey must be configured with a secret key
  
  (Asked by: username_0 on 2021-12-14)
  
  For a while our Craft CMS webshop show errors in the control panel.
  This happens 25%-50% of the requests. Looking in the phperror log a lot of this errors are logged:
  
  [13-Dec-2021 23:00:05 UTC] An Error occurred while handling another error: yii\base\InvalidConfigException: craft\web\Request::cookieValidationKey must be configured with a secret key.
  
  The SECURITY\_KEY is set in the .env and also in /config/general.php
  
  It seams like the server can't read or find the .env sometimes.
  Earlier i found a topic to change the php variable 'variables\_order' EGPCS.
  This was not the solution for me.
  
  Anyone some tips?
  
  Craft CMS 3.7.24  
  PHP 7.4.26   
  Hosted on Siteground
  
  **Tags:** error, env
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-06-15. Score: 2
  
  For anyone getting this error in version 4. For me the php.ini solution also didn't work. It helped to add a key named:
  CRAFT\_SECURITY\_KEY='YOURKEY'
  in the .env file, replace YOURKEY with your actual SECURITY\_KEY
  
  
  ---
  
  