2014-11-17 141 views
2

我已阅读有关类似问题,但几乎所有这些都与双字母域下划线有关。不是我的情况。我正在与Intranet合作,所以没有关于域名的问题。另外,如果我尝试使用域名而不是IP(认为IE可能不信任我的IP),问题仍然存在。互联网浏览器忽略cookies

让我总结的一些事实:

  • 没有两个字母的域问题。
  • 没有下划线问题。
  • 在Intranet 10中不工作。*(HTTP和HTTPS),但工作在172. *和本地。
  • 不是防火墙问题。我已经测试了它没有防火墙,直接指向服务器(Tomcat 7.0.42)
  • 问题只是用IE(IE7测试IE11)。使用Chrome和Firefox。
  • 不是cookie路径问题。我使用'sessionCookiePath'强制cookie路径。请参阅http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
  • 非斜杠问题。我已将'sessionCookiePathUsesTrailingSlash'设置为false并为true。
  • Tomcat始终发送响应头中的cookie,但请求头中没有cookie。
  • 即使使用公共URL访问服务器(具有verisign证书的HTTPS URL),也不能正常工作。
  • 我已将IE配置为接受Cookie并将我的网站添加为可信站点。
  • 我甚至在10.服务器上下载了tomcat安装并运行到我的本地。有用。
  • 对于Firefox,如果使用萤火虫配置为拒绝来自我的网站的Cookie,则行为是相同的。服务器随时发送新的cookie。

这里请求头(我的登录按钮点击):

Solicitar POST /admin/j_spring_security_check HTTP/1.1 
Accept application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* 
Referer https://10.45.17.2/admin/login 
Accept-Language es-ES 
User-Agent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; MS-RTC LM 8; .NET4.0C; .NET4.0E) 
Content-Type application/x-www-form-urlencoded 
Accept-Encoding gzip, deflate 
Host 10.45.17.2 
Content-Length 57 
DNT 1 
Connection Keep-Alive 
Cache-Control no-cache 

响应头

Respuesta HTTP/1.0 302 Found 
Date Mon, 17 Nov 2014 10:21:18 GMT 
Server Apache 
Set-Cookie JSESSIONID=FA5205FEA416706667A0F309465AEA61.nodo2; Version=1; Path="/admin/"; Secure; HttpOnly 
Location https://10.45.17.2/admin/start 
Content-Length 0 
Connection close 
Content-Type text/plain; charset=UTF-8 

用户登录,但服务器应用程序再次需要用户登录页面:

请求标题:

Solicitar POST /admin/j_spring_security_check HTTP/1.1 
Accept application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* 
Referer https://10.45.17.2/admin/login 
Accept-Language es-ES 
User-Agent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; MS-RTC LM 8; .NET4.0C; .NET4.0E) 
Accept-Encoding gzip, deflate 
Host 10.45.17.2 
Connection Keep-Alive 
Cache-Control no-cache 
DNT 1 
Solicitar GET /admin/start HTTP/1.1 
Accept application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */* 
Referer https://10.45.17.2/admin/login 
Accept-Language es-ES 
User-Agent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; MS-RTC LM 8; .NET4.0C; .NET4.0E) 
Accept-Encoding gzip, deflate 
Host 10.45.17.2 
Connection Keep-Alive 
Cache-Control no-cache 
DNT 1 

应答机的读者:

Respuesta HTTP/1.0 302 Found 
Date Mon, 17 Nov 2014 10:21:18 GMT 
Server Apache 
Set-Cookie JSESSIONID=2F868BF115F960E72E1F5ED0DDDD7B19.nodo1; Version=1; Path="/admin/"; Secure; HttpOnly 
Location https://10.45.17.2/admin/login 
Content-Length 0 
Connection close 
Content-Type text/plain; charset=UTF-8 

你可以看到服务器是如何将不同的Cookie。它发生在所有请求。

另外,请注意,我正在使用Struts2和Spring Security。

有什么想法?提前致谢。

回答

0

最后,问题已解决。问题是会话路径中的双焦点。将系统属性FWD_SLASH_IS_SEPARATOR设置为false会解决问题。

-Dorg.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR=false

一些文档:http://wiki.apache.org/tomcat/Cookies