【问题标题】:CORS - cookie doesn't get sent or even setCORS - cookie 没有被发送甚至设置
【发布时间】:2013-08-06 21:05:18
【问题描述】:

我已经设置了withCredentials = true,并且我从服务器获得了以下标头

Access-Control-Allow-Credentials:true
Access-Control-Allow-Headers:DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Accept,Origin,Referer
Access-Control-Allow-Methods:GET, POST, OPTIONS
Access-Control-Allow-Origin:.mydomain.com
Connection:keep-alive
Content-Type:application/json
Date:Tue, 06 Aug 2013 12:37:47 GMT
Server:nginx/1.1.19
Set-Cookie:sessionid=zjn8naedymjj6mm0aqjgxljbs3u1njzf; expires=Tue, 20-Aug-2013 12:37:47 GMT; httponly; Max-Age=1209600; Path=/
Transfer-Encoding:chunked
Vary:Cookie

但 cookie 不会在下一次请求时设置或传输。

【问题讨论】:

    标签: cookies cors setcookie


    【解决方案1】:

    原来我不能只用.domain.com(通配符)和Access-Control-Allow-Origin,我必须用`http://exact.subdomain.example.com'

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-26
      • 2016-08-03
      • 1970-01-01
      • 2015-09-02
      • 1970-01-01
      • 1970-01-01
      • 2023-04-09
      相关资源
      最近更新 更多