你如何确定禁用cookie * *没有javascript和* *无重定向? [英] How do you determine cookies are disabled *without* javascript and *without* redirecting?

查看:110
本文介绍了你如何确定禁用cookie * *没有javascript和* *无重定向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我禁用JavaScript和Cookie,Amazon.com检测cookies是没有重定向禁用。如果单击链接车,也仅仅是购物车页面上获取。

If I disable javascript and cookies, Amazon.com detects that cookies are disabled without a redirect. If you click the cart link, there's only a get on the cart page.

我猜amazon.com是最有可能不使用ASP.NET,但如何将你完成使用ASP.NET不使用javascript和重定向检测禁用Cookie吗?是否可以检测是否cookie是在一个往返禁用?

I'm guessing amazon.com is most likely not using ASP.NET, but how would you accomplish detecting disabled cookies using ASP.NET without the use of javascript and redirecting? Is it possible to detect if cookies are disabled in one round trip?

推荐答案

您不必重定向到得到的饼干。所有你需要的是一个延迟加载内容。

You don't need redirect to get at the cookies. All you need is a delayed load content.

基本上,我相信下面将工作:

Basically, I believe the following would work:

在'GET /index.html'响应设置的Cookie(他们进来的头,并存储的的index.html的接收和渲染)。

The 'GET /index.html' response sets the Cookies (they come in the header, and are stored before index.html is received and rendered).

您可以比检查饼干而服务说'GET /TinyImage.gif如果不碰到缓存的问题和动态图像响应。

You can than check for cookies while serving say 'GET /TinyImage.gif' if you don't run into caching problems and respond to images dynamically.

所以,最后的问题,就是你怎么通知用户从TinyImage要求你的发现?肯定不容易,但如果你使用iframe,而不是一个简单的标签,你基本上可以有一个单一的页面呈现二送请求。

So, the final problem, is how do you inform the user about your findings from the TinyImage request? Definitely not easily, but if you use IFrame instead of a simple tag, you can essentially have two GET requests for a single page render.

或者,你可以真的,真的疯了,居然熄火第一个GET直到第二GET确认浏览器设置。这是某些HTTP向导,但如果你能环绕彗星你的头(没有AJAX,彗星!),它可以派上用场。

Or, you can be really, really insane and actually stall the first GET until the second GET confirms the browser settings. This is for some HTTP wizards, but if you can wrap your head around Comet (not AJAX, Comet!), it can come in handy.

这是绝对有可能,只是非常棘手。我会尝试在ASP.NET这样做?不能承诺什么,但它会共享一个整洁的事情。

It's definitely possible, just tricky. Would I try doing so in ASP.NET? Can't promise anything but it will be a neat thing to share.

这篇关于你如何确定禁用cookie * *没有javascript和* *无重定向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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