Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to sign a cookie manually? #36

Closed
wzup opened this issue Jun 22, 2017 · 1 comment
Closed

How to sign a cookie manually? #36

wzup opened this issue Jun 22, 2017 · 1 comment

Comments

@wzup
Copy link

wzup commented Jun 22, 2017

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)

@wzup
Copy link
Author

wzup commented Jun 22, 2017

@wzup wzup closed this as completed Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant