I have a very simple line of code that set and read a cookie. I kept getting empty value for my cookie and have no understanding why. I have cookie enabled and know that cookies work on the browser.
<HTML>
<HEAD>
<TITLE>Hello World</TITLE>
</HEAD>
<BODY>
<SCRIPT type="text/javascript">
document.cookie = "ding=dong";
</SCRIPT>
<script type="text/javascript">
alert(document.cookie);
</script>
</BODY>
</HTML>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…