【问题标题】:HttpOnly Secure Cookies not being sent未发送 HttpOnly 安全 Cookie
【发布时间】:2021-08-26 00:35:29
【问题描述】:

是的,关于 httpOnly Cookies 的另一个问题。

像很多其他人一样,我被困在同一个地方。

我从服务器获取 cookie,但它从未与其他请求一起发送。 我在 angularjs 中有 mysite.example.com 试图连接到 api.example.com。

这是响应标头:

Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: https://mysite.example.com
Connection: keep-alive
Content-Length: 2855
Content-Type: application/json
Date: Wed, 09 Jun 2021 00:52:54 GMT
Server: Apache/2.4.46 (Amazon) OpenSSL/1.0.2k-fips
Set-Cookie: WEB-TOKEN=158b691a-65fb-49c2-9d88-63bd1935531f;Version=1;Comment=;Max-Age=3600;Secure;HttpOnly;Expires=Wed, 09 Jun 2021 00:52:54 GMT
vary: Origin

然后,在 AngularJS 中,我发送这样的请求(来自 mysite.example.com):

$http.get('https://api.example.com/userdetails', { withCredentials: true, headers: {  } });

有没有什么东西没有发送或者只是错误的?

谢谢!

【问题讨论】:

    标签: javascript angularjs cookies httponly


    【解决方案1】:

    路径。是的。我错过了 %x2F 的路径。 :)

    【讨论】:

      猜你喜欢
      • 2020-11-19
      • 2021-08-05
      • 2023-03-12
      • 1970-01-01
      • 2013-05-29
      • 2018-03-18
      • 2019-01-27
      • 1970-01-01
      • 2020-05-14
      相关资源
      最近更新 更多