0

I am using vue-cookies for my vue.js project. I need to set the secure and HttpOnly attributes

This is the config

Vue.$cookies.config('7d', '', '', true)

according to the doc https://www.npmjs.com/package/vue-cookies but when setting the cookie, I can see in DevTools that the secure attribute is set, but not the HttpOnly

I also tried setting the cookie like this

this.$cookies.set('login', { userData: response }, '7d', null, null, true)

but same result.

  • you can't access `HttpOnly` cookie with JavaScript, but you can use a server-side language to set/get the `HttpOnly` cookie [Set a cookie to HttpOnly via Javascript](https://stackoverflow.com/questions/14691654/set-a-cookie-to-httponly-via-javascript) – Mohammad Masoudi Mar 31 '22 at 10:13

0 Answers0