ASP.NET MVC 获取特定域的 cookie 名称
我们将在域上只有动态命名的 cookie。我怎样才能得到cookie的名称。
获取名称后,我必须向 cookie 添加一个列表,其中也已经添加了其他值。
We will have have only dynamic named cookie on the domain. how can i get the name of the cookie.
After getting the name i have to Add a list to the cookie, which will have other values as well already added.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查看 Request.Cookies 属性它代表客户端浏览器发送的所有 cookie 的集合。您可以循环浏览 cookie,并使用 名称 属性。找到它后,您可以修改它的值财产。作为替代方案,您可以操作 Values 属性。
You could look at the Request.Cookies property which represents a collection of all cookies sent by the client browser. You may loop through the cookies and look for the one you are interested in by using the Name property. Once you find it you may modify it's Value property. As an alternative you could manipulate the Values property.