为什么我不能设置Cookie和重定向? [英] Why can't I set a cookie and redirect?
本文介绍了为什么我不能设置Cookie和重定向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在设置Cookie并执行 302
重定向时出现问题
在Chrome中,未设置Cookie(我没有测试safari),在其他浏览器,我有同样的问题,直到我添加 Path = /
到cookie,现在它的工作。
I'm having a problem setting a cookie and doing a 302
redirect
In chrome the cookie is not being set (I haven't tested safari), in other browsers I was having the same problem until I added Path=/
to the cookie an now it works.
这是标题的外观;状态为 302 Found
This is how the header looks; the status is 302 Found
Content-Type text/html; charset=iso-8859-1
Expires Thu, 01 Jan 1970 00:00:00 GMT
Set-Cookie alasca-flash=error-Message<Required<error-Name<Required<error-Sex<Required<error-Age<Required<;Path=/
Location /messages/sdf
Content-Length 0
Server Jetty(6.1.x)
关于为什么没有设置cookie的任何想法?或任何解决方法?
Any idea on why the cookie is not set? Or any workaround?
推荐答案
请参阅此问题: Safari不设置Cookie,但IE / FF
See this question: Safari doesn't set Cookie but IE / FF does
它提到 WebKit中的此错误报告(由于AFC)
这篇关于为什么我不能设置Cookie和重定向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文