http-proxy-middleware, how to copy all/cookie headers

前端 未结 4 1971
予麋鹿
予麋鹿 2021-02-04 22:19

I am using lite server by John Papa with HTTP proxy middleware by chimurai as a dev server. the problem is with my session cookie, I cannot persist the session cookie that comes

4条回答
  •  [愿得一人]
    2021-02-04 22:40

    Not sure how your localhost:3003 is configured; With or without https:...

    Say you are using http://localhost:3000 (not https:); The Secure cookie attribute from your target might be the cause for your browser to omit the cookie.

    4.1.2.5. The Secure Attribute

    The Secure attribute limits the scope of the cookie to "secure"
    channels (where "secure" is defined by the user agent). When a
    cookie has the Secure attribute, the user agent will include the
    cookie in an HTTP request only if the request is transmitted over a
    secure channel (typically HTTP over Transport Layer Security (TLS)

    source: https://tools.ietf.org/html/rfc6265#section-4.1.2.5

    Browsers may omit cookies based on the algorithm described in: https://tools.ietf.org/html/rfc6265#section-5.4

    Try removing the Secure Attribute and see if that helps

提交回复
热议问题