检查浏览器接受Cookie [英] Check if browser accepts cookies

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

问题描述

有,我可以检查浏览器是否会允许Cookie的方式。

Is there a way that I can check if the browser will allow cookies.

Request.Browser.Cookies 

当禁用cookie不工作。它说,该浏览器可以支持他们。

Doesn't work when cookies are disabled. It says the browser can support them.

我能想到的唯一的另一件事是尝试设置检测Cookie,然后检查,看它是否曾经得到集。

The only other thing I can think of is to try to set a test cookie and then check to see if it ever got set.

反正是有保证的cookies其实是启用。

Is there anyway to make sure cookies are actually enabled.

推荐答案

根据MSDN有没有办法确定饼干被允许或用户禁用。找到它的唯一方法就是通过写它,然后阅读。

According to MSDN there is no way to determine cookies is allowed or disabled by user. The only way to find it out is through writing it and then reading it.

检查确定是否一个浏览器接受Cookie这里

Check the section "Determining Whether a Browser Accepts Cookies" here.

它也有例子,显示了如何读取和写入的cookie,并指出:

It also has examples which show how to read and write cookies, and states:

饼干属性不表明饼干是否已启用。它
  表明当前浏览器是否仅支持本质
  饼干。

The Cookies property does not indicate whether cookies are enabled. It indicates only whether the current browser inherently supports cookies.

这篇关于检查浏览器接受Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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