IE10 appears to handle cookies and subdomains differently than other major browsers (IE8, IE9, Firefox, Chrome, Safari).
We use subdomains extensively for test environments, e.g.:
- user1.devel.example.com
- user2.devel.example.com
- qa.example.com
And our production environment lives at the top, e.g. example.com (and technically at www.example.com as well).
We use the php setcookie($name, $value, $expires)
function naively (no explicit path or domain is specified) to set a cookie, and then clear cookies (when user logs out) by assigning an empty string to the value. This has always worked fine, and each unique subdomain used their own cookies.
IE10 now "shares" the cookie that was set in the TLD with all subdomains. The initial symptom we observed was that no one could log out of the subdomain. We've observed a few things:
- Even though it shares the value, no subdomain is able to clear the cookie.
- When the TLD clears the cookie, it is immediately removed from all subdomains as well.
Has anyone else observed similar behavior to how IE10 stores/applies cookies relative to subdomains? Is there any workaround, other than being explicit about which domain the cookie applies to when sending the initial Set-Cookie header?