English 中文(简体)
浏览器正在丢弃应用程序设置的 Cookies
原标题:Browsers are dropping the Cookies set by application

这是一个有趣的问题。 据说我在我现有的应用程序中引入了一个特性。 应用程序必须在用户同意后才能在用户系统上写一个 Cookie 。 ( 暗指我的应用程序在用户系统上写了很少的 cookie ) 。

因此设计可以截停所有对应用程序的要求, 对于每个请求, 我们检查是否有国旗要求应用程序写入 cookie( 此国旗来自一个特殊页面, 称为 IP ), 或者检查用户机器上的特殊 cookie 表示 协议 cookie 。

如果应用程序在用户机上没有看到一个同意的 Cookie, 它会用 URL 将用户重定向为 IP 。 在 IP 上有一个 接受 Cookie 按钮。 如果用户接受 cookie, 则 ajax 请求会转到服务器, 代码在服务器上检测标记以写入 cookie 并在用户浏览器上写入 cookie 。

我可以看到写曲奇的代码已被执行, 之后的预期是正常处理请求。 但不幸的是, 它会重新定位到IP 。

我有一种强烈的感觉,认为曲奇曲奇被一些浏览器扔掉了。 请建议这里可能有什么问题。 也请让我知道如何检查我的浏览器, 它正在丢掉曲奇曲奇。

我也觉得这跟P3P页头有关,请帮帮忙

最佳回答

可以有两件事:

  1. You are getting redirected to the IP everytime irrespective of the browser.
  2. With few browsers you are getting along into your application and with the rest you are not.

情况1: 您需要在回复中添加 P3P 页头 。 请检查 < a href=" http:// viralpatel. net/blogs/2008/12/ how- to- set- third- party- cookies- with- iframe. html" rel=“ no follow” > http:// viralpatel. net/ blogs/2008/12/ how- to- set- third- party- cookies- with- iframe. html

例 2: 可能很少有像最近版本的 Mozilla Firefox( 12) 这样的浏览器可以隐藏响应状态, 如果它是重定向的话。 默认重定向是永久性重定向, 即状态代码 302 。 在这种情况下, IP 会在 Mozilla 中继续重定向 。

解决方案: 您需要使用临时重定向, 即状态代码 307 。

问题回答

暂无回答




相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

MALICIOUS_CODE EI_EXPOSE_REP Medium

I run findbugs against all of my code and only tackle the top stuff. I finally got the top stuff resolved and now am looking at the details. I have a simple entity, say a user: public class User ...

XSS on jsbin.com

Anyone know if jsbin.com implements any protection for XSS or other javascript attacks? I see jsbin links used fairly regularly on sites like this one and I can t find any indication from the site ...

Make md5 strong

Im making a website that will intergrate with game that only support md5 hashing metod (atm). Which ofc is not especially safe anymore. But how could i make it stronger? Should I just generate long ...

Why running a service as Local System is bad on windows?

I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...

Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

热门标签