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的方法

参考资料

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

posted @ 2018-11-29 20:01  Lulus  阅读(1158)  评论(0编辑  收藏  举报