Node Cookie Manager for Chrome, read / write cookie from sqlite db
npm i chrome-cookie
const ChromeCookie = require('chrome-cookie');
const CCookie = new ChromeCookie();
// Reading cookie
const cookie = await CCookie.getCookie('arshad.com');
// Inserting cookie
const DATA = [
{
'creation_utc': 'now',
'encrypted_value': 'enc2',
'expires_utc': 'never',
'has_expires': 'yes',
'host_key': 'arshad.com',
'is_httponly': 'yes',
'is_persistent': 'no',
'is_secure': 'yes',
'last_access_utc': 'now',
'name': 'arshad',
'path': '/root',
'priority': 'no',
'value': 'kazmi',
'samesite': -1
}
];
await CCookie.setCookie(DATA);
-
getCookie(path)
- Returns cookie json from database for the input path
- Params
- path (String)
- Params
- Returns cookie json from database for the input path
-
setCookie(cookies)
- Adds all the input cookies into the sqlite database
- Params
- cookies (Array of cookies object)
- Params
- Adds all the input cookies into the sqlite database
-
removeCookie(domain)
- Removes all records matching the domain.
-
It uses
like
condition (%domain%
) so anything matching the pattern will be removed- Params
- path (String)
- Params
Interested in contributing to this project? You can log any issues or suggestion related to this library here
Read our contributing guide on getting started with contributing to the codebase