1.0.18 • Published 2 years ago

flask-session-cookie-decoder v1.0.18

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Flask Session Cookie Decoder

A Node.js module for decoding Flask session cookies, allowing you to extract and decompress the data stored within them.

Installation

To install the package, use npm:

npm install flask-session-cookie-decoder

Usage

const { getDecodedSessionCookieJson, getCookieValueByName } = require('flask-session-cookie-decoder');

const cookie = getCookieValueByName('YOUR_COOKIE_NAME_HERE');
const decodedData = getDecodedSessionCookieJson(cookie);

console.log(decodedData);

Function Signature

getDecodedSessionCookieJson(cookie: string): string
getCookieValueByName(name: string): string

Parameters

  • cookie (string): The Flask session cookie to decode. This should be a string representing the Flask session cookie obtained from the client's request.

Returns

  • A string representing the decoded JSON object contained within the Flask session cookie.

Example

const { getDecodedSessionCookieJson, getCookieValueByName} = require('flask-session-cookie-decoder');

const cookie = getCookieValueByName('session');
// example of cookie value: 'eyJpZCI6NSwibmFtZSI6Iml0c2Rhbmdlcm91cyJ9.6YP6T0BaO67XP--9UzTrmurXSmg'
const decodedData = getDecodedSessionCookieJson(cookie);

console.log(decodedData); // {"id": 5, "name": "itsdangerous"}

License

This project is licensed under the MIT License - see the LICENSE file for details.

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago