pillarjs / cookies

Signed and unsigned cookies based on Keygrip
MIT License
1.29k stars 152 forks source link

Support for multiple cookies with the same name from different domains #113

Open zachasme opened 5 years ago

zachasme commented 5 years ago

Resolves #88.

I've added a getAll() method instead of adding a multi option to get() such that the return type doesn't depend on input (which will also lead to saner typescript definitions).

The biggest question is how multiple signed cookies with same name should work when one signature is invalid. I went with removing the signature cookie if any of the signature cookies fail to match a key.

What do you think is the best approach?