Cookies

Thursday, December 5, 2002

It just took me two hours of programming and slamming my head against the desk to realize that Cookies get saved according to the exact URL of the site. I kept trying to delete the cookies of domain.com when I needed to delete the cookies of www.domain.com.

That is annoying.

{ 1 comment… read it below or add one }

1 Adam Kalsey 12.07.02 at 10:50 am

I’m sure you realize this, but that’s on purpose. domain.com and http://www.domain.com are not neccessarily the same site. “www” is just another hostname as far as the browser is concerned. You wouldn’t want the cookies for intranet.domain.com and http://www.domain.com to intermingle, so cookies set for a hostname are specific to that hostname.

However, if you set the cookie on domain.com, you’ll be able to read it from http://www.domain.com, foo.domain.com and any other domain.com hostname.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>