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.

1 Answer 1


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.

  • 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'. Jul 26, 2016 at 19:06
  • 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.
    – Darren
    Jul 28, 2016 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.