如何检查浏览器是否接受cookie [英] how to Check if browser accepts cookies

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

问题描述





确定用户浏览器是否在ASP.NET中启用了cookie的最佳方法是什么

解决方案





根据MSDN,无法确定用户是允许还是禁用cookie。找到它的唯一方法是通过编写然后阅读它。



查看确定浏览器是否接受Cookie部分

http://msdn.microsoft.com/en-us/library/ms178194.aspx [ ^ ]。



它还有一些示例,说明如何读取和写入cookie,并说明:

Quote:

Cookies属性不表示是否启用了cookie。它仅表示当前浏览器是否固有支持cookie。



http://stackoverflow.com/questions/6964481/check-if-browser-accepts-cookies [ ^ ]



谢谢

SP


Hi,

What is the best method for determining if a users browser has cookies enabled in ASP.NET

解决方案

Hi,

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.

Check the section "Determining Whether a Browser Accepts Cookies"
http://msdn.microsoft.com/en-us/library/ms178194.aspx[^].

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

Quote:

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


http://stackoverflow.com/questions/6964481/check-if-browser-accepts-cookies[^]

Thanks
S.P


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

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