maticzav/nookies

Options error with http only

Closed this issue · 2 comments

Pfurr commented

i'm trying to set options for httpOnly. Can anyone explain if possible? How it work? Cookie http only can work in next js with nookies?

I think it's possible. Have you checked the options object?

Pfurr commented

I think it's possible. Have you checked the options object?

yeah, my goal is to store JWT of my headless cms in my client (next js) as Jwt cookie http only, it is possible? i set options http only but don't work... my question is: can you do this client side? @maticzav

Example:
setCookie("", "token", res.data.jwt, options, { maxAge: 30 * 24 * 60 * 60, path: "/", httpOnly: true });

Ps: Please give me a correct example if my code is wrong :)