fn
decodeCookieValue
v0.0.5testedDecodes a cookie value: unwraps an RFC 6265 DQUOTE-wrapped value (the quotes are transport dressing, not payload), then decodes percent-escapes. Malformed escapes (e.g. third-party cookies that never used percent-encoding) are returned as-is instead of throwing.
Examples
ts
decodeCookieValue('a%3Bb'); // 'a;b'ts
decodeCookieValue('"dark"'); // 'dark'Signature
ts
export function decodeCookieValue(value: string): string{ ... }Parameters
| Parameter | Type | Description |
|---|---|---|
value | string | The encoded cookie value |
Returns
stringThe decoded cookie value