Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

During configuration of Ckeditor I have to setup the cookie domain variable. I have added my site in subfolder like www.example.com/mynewsitefolder, where www.example.com is my current and running site.
First I tried something like $cookie_domain = '.example.com/mynewsitefolder'; but that doesn't allow me to log in.

How can I set it, so it works on a sub-folder?

share|improve this question
add comment (requires an account with 50 reputation)

1 Answer

up vote 0 down vote accepted

The short answer is that you cannot set cookie domain to such a value. See http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-domain

As a workaround, you can use this in settings.php (around where $cookie_domain is set:

$cookie_domain = ".example.com";
// Set cookie_path ourselves as Drupal doesn't.
ini_set('session.cookie_path', '/mynewsitefolder/');

$cookie_domain is eventually used to set session.cookie_domain but there is nothing in Drupal code base to set session.cookie_path and so we directly set that in settings.php itself.

share|improve this answer
add comment (requires an account with 50 reputation)

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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