如何识别来自客户端还是服务器端的Cookie? [英] how to identify a cookie is from client-side or server-side?

查看:508
本文介绍了如何识别来自客户端还是服务器端的Cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

浏览器如何区分Cookie是来自客户端创建的(JavaScript)还是服务器端创建的(ASP.NET)。是否可以删除在客户端从服务器端创建的cookie,反之亦然,我正在努力删除使用ASP.NET代码背后的javascript从客户端创建的cookie。

how does the browser differentiate a cookie is from client-side created (JavaScript) or server-side created (ASP.NET). Is it possible to delete cookie created from server side in client side and vice versa, I'm struggling to delete a cookie was created from client-side using javascript in ASP.NET code-behind.

推荐答案


浏览器如何区分Cookie是来自客户端(由JavaScript创建)还是由服务器端(Asp.net)创建。

how does the browser differentiate a cookie is from Client side(javascript created) or serverside created (Asp.net).

不是。 Cookie是cookie。

It doesn't. A cookie is a cookie.

它最接近的是仅HTTP 标志,该标志允许从JavaScript中隐藏cookie。 (这为防止XSS cookie盗窃提供了一些防御措施。)

The closest it comes is the HTTP Only flag, which allows a cookie to be hidden from JavaScript. (This provides a little defence against XSS cookie theft).


可以删除在客户端从服务器端创建的cookie,反之亦然

it is possible to delete cookie created from server side in client side and vice versa

是。 Cookie是Cookie。 (同样,客户端代码无法触摸仅HTTP cookie)

Yes. A cookie is a cookie. (Again, client side code can't touch an HTTP only cookie)

这篇关于如何识别来自客户端还是服务器端的Cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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