vue-cookies
vue-cookies copied to clipboard
httpOnly?
missing httpOnly
HttpOnly cannot be set in the browser client side (in JavaScript). there's no API available to get/set the HttpOnly attribute of the cookie, as that would otherwise defeat the meaning of HttpOnly.
see #51
In my case I just need to make sure the session exist so I wrote this function;
methods: {
doesSessionExist(cookieName) {
this.$cookies.set(cookieName, 'new_value', '1s')
return !this.$cookies.get(cookieName)
}
}
and call like so this.doesSessionExist('session_cookie_name')
if you can set the cookie it does not exist.