funkyLover
funkyLover

Reputation: 127

can i get httpOnly cookie work with vue-resource?

work on a full spa with vue, vue-router, vue-resource, etc. sending request with vue-resource and server will return a response with a set-cookie header, but it is a httpOnly cookie, how could I make this cookie also work with the vue-resource request?

Upvotes: 6

Views: 5944

Answers (1)

Tony Yip
Tony Yip

Reputation: 750

To prevent cross-site scripting (XSS) attacks, HTTP-only cookies aren't accessible via JavaScript through the Document.cookie property, the XMLHttpRequest and Request APIs.

You may refer to here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#Secure_and_HttpOnly_cookies

Upvotes: 5

Related Questions