asp 删除 cookie
时间:2010-08-19 来源:杨小丸
今天发现一个问题,以前删除cookie,我以为直接清空一下cookie:
response.cookie("user_id")=""
但我今天发现,这样的操作在不同的浏览器里表现不同。
在 IE 浏览器和Firefox浏览器中,用 javascript getCookie("user_id") 一个返回 null 一个返回 空字符串。
这样对在javascript中进行判断带来麻烦。
今天到百度搜索了一下,原来删除cookie的最好办法是设置cookie过期:
response.cookies("user_id").expires = now-1
相关阅读 更多 +