I'm using the following code:
<script>
var time = new Date();
time.setFullYear(time.getFullYear() + 1, time.getMonth(), time.getDay());
expires = ";expires=" + time.toGMTString();
document.write(expires);
document.cookie = "aardvark=cats; expires= " + time +"; path=/";
document.write('\ndone: ' + document.cookie);
</script>
I've put it into a html file and ran it locally, and also tried running it on JSFiddle, and tried uploading it to my site and accessing it in my browser.
In internet explorer 9, no cookie is created on my computer. Any ideas why not?
";` and so on... – Elias Van Ootegem Apr 05 '13 at 09:23