Subdomain can't access cookie of primary domain

by realPro   Last Updated July 18, 2015 13:01 PM

I have a system at sub.domain.com

When users access the system a cookie is being set using a primary domain.

cookie = new cookie("myCookie"); cookie.Domain = ".domain.com";

For some reason now I see that the users have 2 cookies:

1) myCookie for domain .domain.com

2) myCookie for domain sub.domain.com

The system was working since the beginning with the .domain.com cookie and then something happened that caused a new sub.domain.com cookie to get created.

The question is what caused the new cookie to get created?

The problem gets even more complicated because currently the problem is gone and the sub.domain.com cookie is not being created any more, so I can't debug the system and understand why the sub.domain.com cookie is created. I am left with users that have both cookies set and I need to understand what are the conditions that can case the second sub.domain.com cookie to get created instead of using the primary domain cookie as usual.

Tags : cookie


Related Questions


Wordpress site and cookies: Browser dependence?

Updated May 19, 2018 05:04 AM




What percentage of users use a cookie blocker?

Updated April 13, 2015 20:01 PM