jed / cookie-node Goto Github PK
View Code? Open in Web Editor NEWsigned cookie functionality for node.js
License: MIT License
signed cookie functionality for node.js
License: MIT License
For opaque cookies, use symmetric encrpytion instead of base64 of the cookie value/payload.
One doesn't always want to share the contents of the cookie with the user, even if tampering with the value is detectable by an invalid signature.
I suppose one could encrypt beforehand? Hmm, maybe that is a better idea.
Thoughts?
Hi!
Couldn;t you kindly add HttpOnly option?
--Vladimir
Hi Jed
Seems like you wrote the almost exact same method twice :
http.IncomingMessage.prototype._parseCookies
The first one is obsolete and should be deleted.
If you want to set multiple cookies you will see that this is impossible. The problem is described in this post http://caolanmcmahon.com/multiple_set_cookie_headers_in_node_js.html
Its undocumented how to use cookie-node alongside a writeHead call. Only checking the source for cookie-node showed me it was looking for headers as an object -- I was passing headers to writeHead as an array of arrays, which is also supported, but cookie-node doesn't work with that.
Several mandatory fields are currently not included: keywords, maintainers, contributors, bugs, licenses, repositories and dependencies. In addition, some of the optional fields may be relevant.
I was reading through the code and couldn't understand how processCookie() could work if the cookie.secret isn't set. In processCookie() If the secret isn't set the localSig gets initialised with a new random secret and will fail the test against remoteSig.
..or have I missed something?
heads up, I think for node.js 0.3.3 compatibility line 86 needs to change from
args.push(headers = []);
to
args.push(headers = {});
... like MIT :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.