asp .net Cookies

Request.Cookies和Response.Cookies

When validating cookies or cookie data from the browser you should use the Request.Cookies collection. 
从浏览器验证cookie或cookie数据时,应该使用Request.Cookies集合
When you are constructing cookies to be sent to the browser you need to add them to the Response.Cookies collection.
在构建要发送到浏览器的cookie时,须要将它们添加到Response.Cookies集合中

参考资料

Cookie does not work in asp.net前端

更新、删除cookie失败的问题

问题的核心是,在浏览器进行cookie操做而不是在后台
因此须要在前端经过ajax调用操做cookie的方法ajax

参考资料

Unable to update cookie in ASP.NET
Does modifying the Response.Cookies collection also change Request.Cookies in .Net?浏览器

相关文章
相关标签/搜索