【问题标题】:http response include set cookie jession id, but then send a request, there is no cookie info in the request headerhttp响应包含设置cookie jession id,但随后发送请求,请求头中没有cookie信息
【发布时间】:2016-05-11 13:14:39
【问题描述】:

浏览器:IE11。 服务器:tomcat + nginx

第一个请求响应:

   cache: no-cache
   Connection: keep-alive
   Content-Type: image/png
   Date: Tue, 10 May 2016 10:47:43 GMT
   Server: Tengine/2.1.1
   Set-Cookie: _uid=CiMDa1cxvE+jjDeFAw56Ag==; path=/
   Set-Cookie: _uid=eff37cac39ac062caba9b5ec2c8a00f4;Path=/
   Set-Cookie: JSESSIONID=AEBC40BA0AD98AA787CC011F3029307C; Path=/; HttpOnly
   Transfer-Encoding: chunked

在这个请求之后,cookie JSESSIONID 应该被存储在浏览器中, 但是当发送第二个请求时,JSESSIONID 不包含在请求标头中。并且响应标头中,服务器设置了另一个 JSESSIONID。

ps: chrome没有问题。 IE直接向tomcat请求是没有问题的。

谁能帮帮我.... :(

【问题讨论】:

  • 在您的 IE 浏览器中检查请求发送的内容,您可以查询 2 个不同的域,或者名称,或者只是端口更改。
  • @Walfrat 我没有请求2个域,端口也没有改变。请求是由javascript发出来更改验证码的,javascript是这样的:$img.attr('src', '/captcha/get.do?t='+ new Date().getTime());

标签: http cookies jsessionid


【解决方案1】:

我找到了原因,因为域名包含一个'_',就像这样:xx_xx.xx.com。 IE不会存储这种域设置的cookie。 我已经更改了域名并测试过,现在可以使用了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-03-10
    • 1970-01-01
    • 2011-06-24
    • 1970-01-01
    • 2013-06-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多