digital-analytics-program / gov-wide-code

Provides a set of javascript files and documentation to implement web analytics on US federal websites
http://www.digital.gov/dap
104 stars 55 forks source link

Cookie appears to have a bug for domain with `www` inside it #19

Closed konklone closed 1 year ago

konklone commented 9 years ago

From this commit/comment:

I see .replace('www.','') in a few places, regarding the cookie domain. It doesn't look like it guarantees that www. begins at the start of the string, so a site whose subdomain had a level which ended in www, e.g. site-www.example.gov would be broken and the cookie would not stick.

konklone commented 9 years ago

A note that this is still the case in 2.0:

Note that I haven't empirically tested this and isolated any issues. However, I strongly suspect this needs a tightened regex in order to prevent bugs on subdomains that aren't www, but incorporate www in them.

tdlowden commented 8 years ago

Marked for review with v3.1