有没有一种方法可以清除当前IE会话中的内存cookie(无需重新启动IE)? [英] Is there a way to clear in-memory cookie in current IE session (without restart IE) ?

查看:89
本文介绍了有没有一种方法可以清除当前IE会话中的内存cookie(无需重新启动IE)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以清除当前IE会话中的内存cookie(而无需重新启动IE)?
像这样的场景:
1.登录网站(例如,代码项目www.codeproject.com)
2.清除内存cookie中的登录信息.
3.按"F5",网站返回登录页面,或显示用户已注销.

Is there a way to clear in-memory cookie in current IE session (without restart IE) ?
the scenario like:
1. login a website (for example, code project www.codeproject.com)
2. Clear in-memory cookie for the login information.
3. press ''F5'', the website get back to login page, or shows that user has signed out.

推荐答案

您是在谈论asp.net登录吗?控制Cookie?它存储一个名为.ASPXAUTH的cookie.它包含一个哈希.如果您在登录后从后面的代码(例如在后面的示例default.aspx代码)中修改哈希,例如Response.Cookies[".ASPXAUTH"].value="xx",则不会再登录.无法刷新页面或ctrl + F5键,无法移动至下一页.所有这些使您无法登录.

获取cookie的一般方法类似于Request.Cookies["cookie name or index"].value(您需要检查cookie是否在获取值之前存在).

回写cookie的方法是Response.cookies["name or index"].value="xxxxx"

但是为什么要在登录后让用户注销?

那是您所期望的吗?否则我不会理解您的问题.
are you talking about asp.net login control''s cookie? It stores an cookie named .ASPXAUTH. It holds a hash. If you modify the the hash from code behind after login (from example default.aspx code behind) like Response.Cookies[".ASPXAUTH"].value="xx" you are not logged any more. Can''t refresh the page or ctrl+F5 , can''t move to next page. All these make you not logged in.

The general way getting the cookies are like Request.Cookies["cookie name or index"].value (you need to check is the cookie exists before getting the value).

The way to write back the cookie is Response.cookies["name or index"].value="xxxxx"

But why you want to make the user logout after login?

Is that what you expected? otherwise I didn''t understand your question.


[ ^ ]链接?


HTH
What about this[^] link?


HTH


这篇关于有没有一种方法可以清除当前IE会话中的内存cookie(无需重新启动IE)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆