Can I get a httpOnly cookie with a vue resource?

work in a full spa with vue , vue-router , vue-resource , etc. sending a request with a vue resource and server will return a response with the set-cookie header, but this is an httpOnly cookie, how can I get this cookie to work with a vue-resource request?

+5
source share
1 answer

To prevent cross-site scripting (XSS) attacks, an HTTP-only cookie is not available via JavaScript through the Document.cookie property, XMLHttpRequest API, and Request API.

You can find here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#Secure_and_HttpOnly_cookies

+1
source

Source: https://habr.com/ru/post/1259757/


All Articles