问题描述
当用户关闭浏览器时,如何清除通过我的asp.net mvc(C#)应用程序存储的Cookie?
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?
我需要使用cookie,因为我将存储一些值,直到浏览器关闭。
I need to use cookies, because i will store some of the values to be maintained until the browser is closed.
例如,在登录期间i可以将cookie存储在cookie中,我可以用于我的申请流程,直到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.
会话将在特定时间过后使用cookies克服。
Session will expire after some particular time, which i need to overcome with using cookies
推荐答案
会话通常用于此。根据,如果未设置过期日期,则当用户
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关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!