Redefine cookie domain for subdomains

by Nicholas Finch   Last Updated July 17, 2017 00:08 AM

I have done all the research on this question but none of it is working.

I have an application consisting of a WordPress site at "domain.com", and a CakePHP/Angular application at "sub.domain.com".

I need my WordPress login cookie to be usable at "sub.domain.com". I have read many things on this topic and everyone recommended I put in my wp-config.php file

define('COOKIE_DOMAIN', '.domain.com');

This however is not redefining the domain for the cookie.

By contrast, as a test, in the Cake/Angular application, I manually defined a cookie in javascript at .domain.com, and when I go back to the WordPress site that cookie is available for use at both domain.com AND sub.domain.com.

What am I doing wrong that is causing WordPress to not redefine the cookie domain successfully?



Related Questions


How I can share cookies from my dimain to subdomain?

Updated February 26, 2018 14:08 PM




ERR_TOO_MANY_REDIRECTS when i config my subdomains

Updated August 03, 2018 14:08 PM