fastify-cookie icon indicating copy to clipboard operation
fastify-cookie copied to clipboard

Why is there automatic cookie signing?

Open gabor-s opened this issue 1 year ago • 1 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the issue has not already been raised

Issue

If I set a cookie with setCookie and I configured this plugin with signed: true then the cookie will be automatically signed. However when I read the cookie there's no automatic unsigning, I have to do it manually by calling unsignCookie. What is the reasoning behind this imbalanced behavior?

gabor-s avatar May 22 '24 11:05 gabor-s

Thanks for reporting!

Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.

mcollina avatar May 22 '24 14:05 mcollina

It's because in other parts of an application you might have signed: false and it would hurt performance to try to unsign every potential cookie

gurgunday avatar Oct 09 '24 10:10 gurgunday