it-tools icon indicating copy to clipboard operation
it-tools copied to clipboard

Cookie Parser

Open edforth opened this issue 7 months ago • 3 comments

What type of request is this?

New tool idea

Clear and concise description of the feature you are proposing

I would love a tool that could parse cookie name/value pairs from a header string.

Is their example of this tool in the wild?

I've been using this: https://cookie-parser.michaelbonner.dev/ I like it

I found an NPM package here, but I haven't used it or checked it out. https://www.npmjs.com/package/cookie-parser

Additional context

No response

Validations

  • [x] Check the feature is not already implemented in the project.
  • [x] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • [x] Check that the feature can be implemented in a client side only app (IT-Tools is client side only, no server).

edforth avatar May 07 '25 00:05 edforth

Hi @edforth , implemented here : https://sharevb-it-tools.vercel.app/cookies-parser

sharevb avatar May 10 '25 08:05 sharevb

@sharevb There seems to be a bug with the parser for "PREF=tz=America.Los_Angeles&f7=100&f4=4000000; __Secure-3PAPISID=abcd; wide=1". It returns PREF=tz instead of the entire string until ;. The original implementation https://cookie-parser.michaelbonner.dev/ has the same problem, so it can't be trusted. The correct output should be PREF tz=America.Los_Angeles&f7=100...

IXHtHCAIKGUbRxV0LTy avatar May 10 '25 09:05 IXHtHCAIKGUbRxV0LTy

Hi @IXHtHCAIKGUbRxV0LTy , should be ok now at: https://sharevb-it-tools.vercel.app/cookies-parser?cookies=a=a=a=a=

sharevb avatar May 13 '25 21:05 sharevb