To optimize my site i have set up a static subdomain for content such as images, css and javascript. How do i stop the google analytics tracking cookie from being sent to my static subdomain, but still to both example.com and www.example.com?
Have already looked through some of the documentation with no luck
You can't have a cookie that gets sent to www.example.com and example.com but not othersubdomain.example.com.
You can in theory have a cookie that gets sent to example.com but not subdomain.example.com, but it doesn't work in IE.
This is why you should not use a no-www example.com address when you are planning on using subdomains with their own security context. It's best to have only one of www.example.com and example.com as the ‘proper’ URL anyway. So set up a redirect for example.com to go to www.example.com, and cookies won't be shared unless you deliberately set domain=.example.com on them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With