How to set up 'httpOnly' and 'secure' cookie options with react-cookie-consent?

1.3k views Asked by At

My website is running under HTTPS and I try to save the react-cookie-consent cookie as 'httpOnly' and 'secure'. What I tried so far, without success, was cookieSecurity and extraCookieOptions like this:

<CookieConsent
 location="bottom"
 buttonText="I understand"
 cookieSecurity={true}
 extraCookieOptions={{
   httpOnly: true,
   secure: true
 }}>
 This website uses cookies to enhance the user experience.
</CookieConsent>

Here is the NPM package https://www.npmjs.com/package/react-cookie-consent

Do I miss something in documentation?

0

There are 0 answers