Safari在表单提交后返回302 HTTP状态代码

时间:2013-08-19 14:20:52

标签: apache http iframe safari http-headers

我在Safari浏览器中使用 POST方法进行表单提交时遇到问题。在Safari浏览器中提交表单后,返回状态码302并重定向到 GET方法。表单在跨域页面上加载为 iframe 。在其他浏览器中,提交工作正常(状态代码为200)

Request Method:POST
Status Code:302 Found

请求标题:

 Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
 Content-Type:application/x-www-form-urlencoded
 User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2

回复标题

Date: Mon, 19 Aug 2013 13:47:56 GMT
p3p: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Connection: close
Content-Length: 0
Pragma: no-cache
Server: Apache/2.2.3 (CentOS)
Content-Type: text/plain; charset=UTF-8
Cache-Control: no-cache, no-store
Expires: Thu, 01 Jan 1970 00:00:00 GMT

表单数据

selectedDate:19.8.2013
selectedTimeString:19:00

有没有人遇到过这个问题?

Web服务器:Apache Tomcat 5.5 + Spring MVC

1 个答案:

答案 0 :(得分:0)

这是因为Safari会在默认配置中阻止第三方 Cookie。解决方案是使用URL来共享sessionId。