5

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?

1 Answer 1

6

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.

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.