Answers.Body: <p>OK, turns out this was due to erroneous entries in the Drupal settings.php file. The following entries were causing cookies to be missed by Civi:-</p>
  
  <pre><code> ini_set('session.cookie_lifetime',  2000000);
   ini_set('session.gc_maxlifetime',   200000);
  </code></pre>
  
  <p>Others may also cause inconsistencies, such as:-</p>
  
  <pre><code> ini_set('session.cache_expire',     200000);
   ini_set('session.cache_limiter',    'none');
   ini_set('session.cookie_lifetime',  2000000);
   ini_set('session.gc_maxlifetime',   200000);
   ini_set('session.save_handler',     'user');
   ini_set('session.use_cookies',      1);
   ini_set('session.use_only_cookies', 1);
   ini_set('session.use_trans_sid',    0);
  </code></pre>
  
  <p>Removing the entries from the drupal settings.php file, then closing the browser and re-establishing a new session has resolved the issue.</p>
  
  <p>Essentially these settings within Drupal are conflicting with the PHP.ini settings that CiviCRM is seeing, which can lead to these erroneous types of session errors.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-26T19:06:47.453Z
Answers.Text: Darren thanks for reporting this and figuring out the cause. Has removing the Drupal settings caused any side effects? Is there any reason not to do the same fix if (as I am) getting the same error - 'Could not find valid value for ct'.
Answers.UserDisplayName: Joe McLaughlin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-28T13:36:33.370Z
Answers.Text: Hi Joe, these settings were for Drupal 6 and they override the default php.ini settings. Removing them should be fine for Drupal 7, but you will need to check the Drupal sessions still work fine (logged in users). The  'Could not find valid value for ct' error is to do with session handling, so it could be your php.ini settings rather than the ones in the settings.php for Drupal. Hope this helps.
Answers.UserDisplayName: Darren
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-08T13:31:55.230Z
Answers.LastActivityDate: 2016-06-08T13:31:55.230Z
Answers.UserDisplayName: Darren
Body: <p>Performed upgrade of Civi 4.4 to 4.6 alongside upgrade of Drupal from version 6 to version 7. The Drupal upgrade went fine, as did the CiviCRM upgrades (i.e. no errors were reported).</p>
  
  <p>All dashboards and search functions in CiviCRM work fine, but as soon as I try and create anything (e.g. registering for an event, creating a new Individual, etc...) we get the error: "Could not find valid value for ct".</p>
  
  <p>Searching forums showed this is an old error related to sessions, so checked over all the PHP.ini and Nginx settings to ensure cookies and other domain related settings were correct.</p>
  
  <p>Can anyone point me in the right direction of where else to look?</p>
  
  <p>** EDIT *** Additional error messages being shown after enabling debug:-</p>
  
  <blockquote>
    <p>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.<br /><br />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 <a href="http://example.org" rel="noreferrer">http://example.org</a>, but some users are accessing
    the page via <a href="http://www.example.org" rel="noreferrer">http://www.example.org</a> or a domain alias like
    <a href="http://myotherexample.org" rel="noreferrer">http://myotherexample.org</a>.<br /><br />Error type: Could not find a
    valid session key.</p>
  </blockquote>
  
Tags: <drupal><upgrade><4.6><drupal-6><4.4>
Title: How do I debug "Could not find valid value for ct" error message
ThreadText: # How do I debug "Could not find valid value for ct" error message
  
  (Asked by: username_0 on 2016-06-08)
  
  Performed upgrade of Civi 4.4 to 4.6 alongside upgrade of Drupal from version 6 to version 7. The Drupal upgrade went fine, as did the CiviCRM upgrades (i.e. no errors were reported).
  
  All dashboards and search functions in CiviCRM work fine, but as soon as I try and create anything (e.g. registering for an event, creating a new Individual, etc...) we get the error: "Could not find valid value for ct".
  
  Searching forums showed this is an old error related to sessions, so checked over all the PHP.ini and Nginx settings to ensure cookies and other domain related settings were correct.
  
  Can anyone point me in the right direction of where else to look?
  
  \*\* EDIT \*\*\* Additional error messages being shown after enabling debug:-
  
  > 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.
  
  **Tags:** drupal, upgrade, 4.6, drupal-6, 4.4
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-06-08. Score: 6 | Accepted answer
  
  OK, turns out this was due to erroneous entries in the Drupal settings.php file. The following entries were causing cookies to be missed by Civi:-
   ini_set('session.cookie_lifetime',  2000000);
   ini_set('session.gc_maxlifetime',   200000);
  
  Others may also cause inconsistencies, such as:-
   ini_set('session.cache_expire',     200000);
   ini_set('session.cache_limiter',    'none');
   ini_set('session.cookie_lifetime',  2000000);
   ini_set('session.gc_maxlifetime',   200000);
   ini_set('session.save_handler',     'user');
   ini_set('session.use_cookies',      1);
   ini_set('session.use_only_cookies', 1);
   ini_set('session.use_trans_sid',    0);
  
  Removing the entries from the drupal settings.php file, then closing the browser and re-establishing a new session has resolved the issue.
  Essentially these settings within Drupal are conflicting with the PHP.ini settings that CiviCRM is seeing, which can lead to these erroneous types of session errors.
  
  > **Comments:**
  > **username_1**: username_0 thanks for reporting this and figuring out the cause. Has removing the Drupal settings caused any side effects? Is there any reason not to do the same fix if (as I am) getting the same error - 'Could not find valid value for ct'.  
  > **username_0**: Hi Joe, these settings were for Drupal 6 and they override the default php.ini settings. Removing them should be fine for Drupal 7, but you will need to check the Drupal sessions still work fine (logged in users). The  'Could not find valid value for ct' error is to do with session handling, so it could be your php.ini settings rather than the ones in the settings.php for Drupal. Hope this helps.  
  
  ---
  
  