I understand how to set the cookie to be httpOnly on the server side when using express and jwt.
res.cookie("jwt", accessToken, { secure: true, httpOnly: true })
However how can we leverage the httpOnly on the client side to make the authentication process secure and prevent the cookie from being hijacked? Can you explain with an example please?
I am also trying to understand the difference between accessing a cookie when httpOnly is false and another cookie when httpOnly is true. I understand the latter will return empty string but where do we use it on the client side when using jwt for authentication. Should we just send an ajax call and not to bother about anything else?