Get and store cookie (from Set-Cookie) from an AJAX POST response

You can’t get the cookie data in your JS. The API won’t allow you.

What do I have to do to save the cookie in my front end app?

Just set the Set-Cookie header in the response from the server side code. The browser should save it automatically.

As a developer, you may be able to inspect the value of the cookies using “Developer Tools”.

And the same cookie will be sent in subsequent requests to the same domain, until the cookie expires.

Leave a Comment