以下代码未能在我的硬盘上的以下位置导致保存的.txt Cookie:C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Cookies
我使用Chrome元素检查器调试页面,但没有显示任何Cookie。我是否因为创建一个简单的cookie而误解了什么?
<!DOCTYPE html>
<html>
<body>
<script>
document.cookie="username=test cookie; expires=Thu, 18 Dec 2020 12:00:00 UTC";
alert("done");
</script>
</body>
</html>
答案 0 :(得分:1)
您正在查找Internet Explorer Cookie的文件夹,而不是Chrome's cookies。
浏览器可能不支持从file://
URI打开的文档中的Cookie。