What is the cookie dot rule?
Asked Answered
I

1

5

I am using Google Analytics and Google Website Optimizer together. On our development rig I suddenly realized that some cookies were set twice.

The GA cookies:

__utma
__umtb
__utmc
__utmz

where all set both by GWO and GA. I had only expected to see one set of these cookies. GWO set them with a dot in front of the domain name:

.dev.example.com

While GA set them as:

dev.example.com

I tried to google this and read something about it in RFC2109 HTTP State Management Mechanism

Searches for it here on SO, results in a number of answers referencing the "cookie dot rule", but I still don't really get it.

What exactly is that rule and which implications does it have?

Immersionism answered 12/3, 2009 at 12:56 Comment(0)
B
11

I take it you understand the basics of how cookies work, namely that with any HTTP request, the browser will send all "relevant" cookies that it has stored.

A cookie set for domain 'example.com' will only be relevant for requests to http://example.com, whereas a cookie for '.example.com' will be relevant to all its subdomains too

Blintze answered 12/3, 2009 at 13:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.