PricingBlog

Use HTTP cookies without sending them in the body at login

  • mxi012-1413381891909877760

    π“œπ“ͺ𝔁𝓲

    5 months ago

    Were using our own backend. This sends cookie data as set cookie and http cookie. So its not accessible via JS. Is it possible to get this cookie in a way where we proxy it via nordcraft proxy and make it available on the page as *.nordcraft.com cookie. So our frontend can use the cookie in dev.

    In prod its working because our backend domain equals the frontend domain. Cookes are set with "Lax"
  • mxi012-1413382457520033923

    π“œπ“ͺ𝔁𝓲

    5 months ago

    Currently were getting unauthorized errors on all APIs because the cookie is somehow not accessible at the SSR state. (in my understanding the server should be able to read the cookie for ssr?)
  • Tod-1413382458975453396

    Tod

    5 months ago

    Great job @π“œπ“ͺ𝔁𝓲! Your contribution to the Nordcraft Community just made you advance to Community Level 5! 🌲
  • erikbeus-1413492624760770732

    Erik Beuschau

    5 months ago

    The cookie header is not forwarded when you proxy API requests as that could cause security issues. You could forward the cookie in a custom header (or the body) of your request though, by reading it using [the Get Cookie](https://docs.nordcraft.com/references/formulas#get-cookie) formula. That also works during ssr
  • mxi012-1413510375416266825

    π“œπ“ͺ𝔁𝓲

    5 months ago

    Thanks @Erik Beuschau
    πŸ‘1