cookies
cookies copied to clipboard
1.0.0
basically hits all the 1.0.0 milestones
- API has changed to
var cookies = require('Cookies')([options], [keys])thenreq.cookies = res.cookies = cookies(req, res). - automatically works as middleware, so you can do
app.use(require('cookies')([keys])) .get()and.set()now only set raw cookies.sign()and.unsign()for signed cookies, with.encodedto optionally base64 encode as well. maybe a better name for.unsign().encode()and.decode()for base64 encoded cookies.encrypt()and.decrypt()for encrypted cookies.clear()to clear a cookie quickly
i found juggling all the options a little weird since you could have combos. thus i opted to have each of them be a pair of methods.
Option changes:
overwritedefaults totrue
To do:
- [ ] secure proxy stuff, waiting on @dougwilson on that :D
- [ ] node 0.8 support as there seems to be an issue with buffers or something
Maybe:
- I took out the framework tests (since i rewrote everything basically). might need to add those
- Pretty sure this will break in connect2/express3 as it assumes you don't use the setHeader patch
- A way to do iv's with encrypted cookies would be nice
- More tests in general would be nice
To test, you need to install keygrip master and npm link it since i haven't published v2 yet
please test and give me feedback before i push v1
/cc @dougwilson @Fishrock123
@jonathanong is this dependant on expressjs/keygrip#14 (keygrip 2.0.0) ?
is this dependant on expressjs/keygrip#14 (keygrip 2.0.0) ?
yes
node 0.8 support as there seems to be an issue with buffers or something
Keygrip is 0.10+ anyways, so.. (Well, the current master is.)
Keygrip is 0.10+ anyways, so.. (Well, the current master is.)
See https://github.com/expressjs/keygrip/commit/71df3df32feec76ed9288d764bc4bd4fc475ba11#commitcomment-6552647
It can likely be made node 0.8, I just have to look into it. I just want them to release node 0.12 already!
I just want them to release node 0.12 already!
Yeah, but we are honestly looking at months still. It isn't really that near ready. :/
Yeah, but we are honestly looking at months still.
Yea, that's what sucks :( If they did rel 0.12, I would be more willing to drop node 0.8 support for things is all :)
I'm surprised people still use 0.8 - at this point it really isn't (that) more stable than 0.10, and npm is broken in it, etc.
Aside from a couple obscure minor performance regressions. (/off-topic rant)
There are certain private PaaS systems (not to name names) where the 0.10 on them is 0.10.1, which is extremely buggy, so there is no other choice.
where the 0.10 on them is 0.10.1
oh god
oh god
it was also the release before Joyent turned off heartbeats, so it is vulnerable to heartbleed.
Travis is just failing on 0.8 as of this time
cool :) just let it keep failing until i check out what it would take to make 0.8 work :)
so aside from the keygrip stuff which can just easily disabled by checking whether the methods exist, the other issue seems to be something about missing this function in 0.8: http://nodejs.org/api/buffer.html#buffer_buf_copy_targetbuffer_targetstart_sourcestart_sourceend

buf.copy exists in node.js 0.8: https://github.com/joyent/node/blob/v0.8.26/lib/buffer.js#L515
Looks like the error you posted is caused because at least one of the array elements you passed into Buffer.concat was not a Buffer: https://github.com/joyent/node/blob/v0.8.26/lib/buffer.js#L505
Hmmm maybe crypto api changed then
Maybe, haha. I plan to knock out the first todo tomorrow, perhaps I'll look into node.js 0.8 as well to determine if whatever the issue is can be made to work there or not.
The current master keygrip has Node.js 0.8 support again, BTW.
I'm sorry for asking, when do you plan to release v1.0.0?
When the kinks are worked out.
Waiting for 1.0.0~~~ :100:
Any progress?
stop? @jonathanong
@dougwilson what's the status on this? should i rebase? or did you have some ideas?
@dougwilson any status updateS?