是否有可能知道浏览器是否在第一次访问时启用了Cookie [英] Is it possible to know if browser has cookies enabled on the very first access

查看:628
本文介绍了是否有可能知道浏览器是否在第一次访问时启用了Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在第一次访问网站时,是否可以知道浏览器Cookie是否由于GET请求而激活?

On a very first access to a website, is it possible to know if browser cookies are activated thanks to the GET request?

这是可能的,特别是在J2EE上下文?在服务器端(没有ajax / js解决方案)

Is it possible particularly in a J2EE context? On the server side (no ajax/js solution)

推荐答案

简短答案:否。

HTTP请求根本不包含这种信息。它只能通过尝试向客户端发送一个,并查看它是否使用它来隐式地测试。可能还有各种javascript选项,但你明确不想要其中的一个。

The HTTP request does simply not carry that kind of information. It's only implicitly testable by trying to send one to the client and see if it uses it or not. There are probably also various javascript options, but you explicitly did not want one of those.

这篇关于是否有可能知道浏览器是否在第一次访问时启用了Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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