在网络浏览器中处理Cookie ... [英] handling cookies in web browser...

查看:99
本文介绍了在网络浏览器中处理Cookie ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想要在Web浏览器中处理Cookie的代码.
即,在退出网络浏览器应用程序时,所有cookie均应
被清除,历史也应该被清除..


在哪种情况下应粘贴或编写此代码,以及如何将其与Web浏览器链接...

wants code for handling cookies in web browser.
i.e,on exiting web browser application it all cookies should
be cleared and also history should be cleared..


in which event should this code be pasted or written and how to link it with web browser...

推荐答案

请按照本文中的说明查看delete_cookie() JavaScript和Cookies [本文 [
Have a look at delete_cookie() as described in this article JavaScript and Cookies[^].

This article[^] discusses removing cookies as well.

However note that the cookie is not actually deleted and that browsers may still store them until they are explicitly removed.


示例:
Response.Cookies("userName").Value = "patrick"
Response.Cookies("userName").Expires = DateTime.Now.AddDays(1)

Dim aCookie As New HttpCookie("lastVisit")
aCookie.Value = DateTime.Now.ToString()
aCookie.Expires = DateTime.Now.AddDays(1)
Response.Cookies.Add(aCookie)


这篇关于在网络浏览器中处理Cookie ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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