A little info on this cookie example, pls


Before I started this exercise on cookies below, the author had be set my browser (firefox in my case) to ask every time, so it would ask if I wanted to allow the cookie.
First I set myCookie to just the cookieName & value, and it worked as expected --the browser displayed the privacy alert asking me if I wanted to allow the cookie, as expected. Then I added the date, and again I got the privacy alert, just as I was supposed to. Next the path – same results.

But, when I added the domain, I did not get the privacy alert. Can you pls. tell me why not?


<title>Hello Cookie</title>
<script type = “text/javascript”>

var cookName=“testcookie”;
var cookVal=“testvalue”;

var date = new Date();
var expireDate = date.toGMTString();

var path=“;path=/”;
var domain = “;domain=braingia.org”;

var myCookie=cookName + “=” + cookVal + “;expires=” + expireDate + path + domain;
document.cookie = myCookie;

Oh, I think I already know…it’s because the domain must specify the server that’s sending the content, right? It that’s it, then how do I test this? I’m just running this code on my computer – what would I use for the domain name?