The cookie will still be visible, but it has a signature, so it can determine if the client has modified the cookie.
It works by creating HMAC values โโ(current cookie), and base64 encoded it. When a cookie receives a read, it recounts the signature and ensures that it matches the signature attached to it.
If it does not match, then it will throw an error.
If you want to hide the contents of a cookie, you must encrypt it (or just save it in a server-side session). I'm not sure if the middleware for this is already there or not.
Edit
To create a signed cookie you must use
res.cookie('name', 'value', {signed: true})
And to access the signed cookie, use the signedCookies req object:
req.signedCookies['name']
staackuser2 Aug 10 '12 at 8:40 2012-08-10 08:40
source share