cookie
cookie copied to clipboard
HTTP server cookie parsing and serialization
my bro sends weird cookies (after deleting and installing cookies again): ``` user_id=; session_id=; session_id=XXXXXXX; user_id=6 ``` `cookie-parser` parse e.g. `user_id` as a `''` but expected reading a latest value...
This PR caches `str.length` (since the string length stays the same across the function). In addition, I've also added an early return for cookie strings that are below the min....
see https://github.com/fastify/fastify-cookie/pull/194#issuecomment-1184444263 Before & after as diff: https://www.diffchecker.com/hO2It0SH on node v16 (`unquote` -> +300 000 op/s)
Fixes https://github.com/jshttp/cookie/issues/60
Updates the serialize method to accept objects of key-value pairs. ~~If the object of key/value pairs contains multiple pairs, then allow the optional options object to specify only an encoding....
The serialize method should be updated to accept an object of key/values and serialize to a cookie string. This would make the serialize/parse methods complement each other.
Adds a script to create the ESM version of the code, fixing #152 The script is automatically run on `prepare` (i.e. when packaging for release or installing directly from git)...
Hi thanks for this great project. I know this has been discussed a couple of times before but not resolved. I'm using Rollup for my project and `cookie` is currently...
As requested in #162 as a non-breaking change prior to a change of error messages for a future major release, standard Node error codes have been added to each of...