Here is the code snippet I am currently using:
<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 have embedded this code in an HTML file and tested it locally as well as on JSFiddle. Additionally, I uploaded it to my website and tried accessing it through my browser.
However, when testing in Internet Explorer 9, I noticed that no cookie was being created on my computer. Any insights into why this might be happening?