How to sign a cookie manually?
wzup opened this issue · comments
wzup commented
For the sake of testing, I need to provide a signed cookie with HTTP request. So that, my server can consider it as a signed cookie and put it into req.signedCookies
object.
However I cannot find a appropriate method in docs.
I'd like to do the following:
let signed = cookieParser.signYourCookie({ cookieName: 'cookieValue' }, secretString);
// => cookieName=cookieValue.9PuJzypXeGq3tc2fFvlukjgNZ518jk
That is an operation opposite to cookieParser.signedCookie(str, secret)
(link)