Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

The WordPress Codex clearly states that if your website is served from, for the sake of performance, you can have the cookies served from by adding this to your wp-config.php:

define('COOKIE_DOMAIN', '');


  • The cookies are still being served from and not What's wrong? or does this no longer work?

PS: Edited to be precise.

share|improve this question
So well that I've searched, I could find no "exact duplicate" to this. Here's something very related and helpful (for my own reference). – its_me Jun 27 '12 at 3:45

1 Answer 1

up vote 1 down vote accepted

Looks like I mis-interpreted what's said in the codex. So, here's the thing...

This is what WordPress does by default: define('COOKIE_DOMAIN', ''); — which means, cookies are sent with all the sub-domains, including itself, even if your WordPress website itself is hosted on

Basically the point is, when your WordPress site is served from, you can also have the cookies sent only with and not other sub-domains, by adding this in your wp-config.php:

define('COOKIE_DOMAIN', '');

So, at most, what the aforementioned code does is restrict the cookies to the sub-domain that serves your WP site.

NOTE: And just in case it's not clear -- it's pointless to use define('COOKIE_DOMAIN', ''); when your site itself is served from or some other sub-domain, and not ''.

share|improve this answer

Your Answer


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.