Safari不设置Cookie,但IE / FF [英] Safari doesn't set Cookie but IE / FF does

查看:130
本文介绍了Safari不设置Cookie,但IE / FF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在safari上发现了一个奇怪的cookie问题。如果您冲浪到 http://2much.ch ,您可以输入FF / IE并在网站内冲浪。

I found a strange cookie problem on safari. If you surf to http://2much.ch you can enter with FF/IE and surf inside the site.

但是如果你使用safari,你只能输入一次;你不能在网站内冲浪。我发现Safari没有设置输入的cookie,但FF / IE。

But if you use safari, you can enter only once; you can't surf inside the site. I found that Safari doesn't set the entered cookie, but FF/IE does.

这里有什么问题?

推荐答案

看起来你在这里碰到Safari bug;您在同时设置cookie时会将任何访问的浏览器重定向到/ entry,而Safari在遇到302 HTTP状态时会忽略Set-Cookie头:

It looks like you hit a Safari bug here; you are redirecting any visiting browser to /entry while setting the cookie at the same time, and Safari is ignoring the Set-Cookie header when encountering the 302 HTTP status:

$ curl -so /dev/null -D - http://4much.schnickschnack.info/
HTTP/1.1 302 Moved Temporarily
Server: nginx/0.7.61
Date: Sun, 19 Jul 2009 12:20:49 GMT
Content-Type: text/html;charset=utf-8
Connection: keep-alive
Content-Length: 14260
Content-Language: de
Expires: Sat, 1 Jan 2000 00:00:00 GMT
Location: http://4much.schnickschnack.info/entry
Set-Cookie: colorstyle="bright"; Path=/; Expires=1248092449.12
Set-Cookie: _ZopeId="73230900A39w5NG7q4g"; Path=/

技术上来说,这将是苹果基础类中的一个错误, a href =https://bugs.webkit.org/show_bug.cgi?id=3512 =nofollow noreferrer> WebKit错误说明是这种情况。

Technically, this would be a bug in Apple's Foundation Classes, I've found a WebKit bug that states this is the case.

我假设解决方法是设置cookie不在index_html中,而是在条目中。

I suppose the workaround is to set the cookie not in index_html but in entry instead.

这篇关于Safari不设置Cookie,但IE / FF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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