fastify / fastify-secure-session

Create a secure stateless cookie session for Fastify
MIT License
201 stars 45 forks source link

Handle signed cookies #222

Closed JohanManders closed 4 months ago

JohanManders commented 4 months ago

Before this commit, when using signed: true inside the cookie settings for fastify-secure-session, the cookie was passed without unsigning the cookie, so it would always be invalid. After this commit, signed sessions should work fine.

I added a test file to show it works and that tampering the cookie will invalidate a signed cookie. The test will fail in the old version.

Checklist