在浏览器关闭清除Cookies [英] Clear cookies on browser close
问题描述
如何清除已存储在我的asp.net的MVC(C#)应用程序,当用户关闭浏览器?饼干
How to clear the cookies that has been stored through my asp.net mvc(C#) application, when the user closes the browser?
是否有任何选项来创建一个cookie,使其到期一次在浏览器关闭?
Is there any option to create a cookie such that it expires once the browser closed?
我需要使用cookies,因为我会存放一些值来维持,直到关闭浏览器。
I need to use cookies, because i will store some of the values to be maintained until the browser is closed.
例如,在登录过程中我可以存储在cookie中的用户ID,它直到bwoser关闭我可以用我的应用程序的过程。
For example, During sign in i may store the userid in cookie, which i can use for my application processes till the bwoser closes.
会议将某些特定的时间,我需要使用Cookie来克服后过期
Session will expire after some particular time, which i need to overcome with using cookies
推荐答案
会话被usualy用于此。据维基百科,当没有到期日设置,一个cookie是当用户关闭浏览器清除。
Sessions are usualy used for this. According to Wikipedia, when no expiration date is set, a cookie is cleared when the user closes the browser.
该Cookie设置器可以指定删除日期,在此情况下,cookie将在该日期被移除。如果cookie二传手没有指定日期,一旦用户退出他或她的浏览器cookie将被删除。
The cookie setter can specify a deletion date, in which case the cookie will be removed on that date. If the cookie setter does not specify a date, the cookie is removed once the user quits his or her browser.
这篇关于在浏览器关闭清除Cookies的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!