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.


There is one comment on this post

  1. 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.

Add to the discussion:

I'll never share your email address and it won't be published.

What Is This?

davidgagne.net is the personal weblog of me, David Vincent Gagne. I've been publishing here since 1999, which makes this one of the oldest continuously-updated websites on the Internet.

bartender.live

A few years ago I was trying to determine what cocktails I could make with the alcohol I had at home. I searched the App Store but couldn't find an app that would let me do that, so I built one.

Hemingway

You can read dozens of essays and articles and find hundreds of links to other sites with stories and information about Ernest Hemingway in The Hemingway Collection.