CRUD operation on browser sqlite cookie store (cross platform)
MIT License
CRUD operations on browser cookies store in Sqlite. ( CrossPlatform )
npm i cookie-crud
const CookieCrud = require('cookie-crud');
const CC = new CookieCrud();
const ChromeCookie = CC.getChrome();
const FirefoxCookie = CC.getFirefox();
// Reading cookie
const cookie = await FirefoxCookie.getCookie('arshad.com');
// Inserting cookie
const DATA = [
{
'baseDomain': 'arshad.com',
'originAttributes': '',
'name': 'arshad',
'value': 'arshad-test-cookie',
'host': 'arshad.com',
'path': '/root',
'expiry': 1,
'lastAccessed': 111111111,
'creationTime': 10001110,
'isSecure': 1,
'isHttpOnly': 0,
'inBrowserElement': 0,
'sameSite': 0,
}
];
await FirefoxCookie.setCookie(DATA);
// Reading cookie
const cookie = await ChromeCookie.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 ChromeCookie.setCookie(DATA);
getCookie(path)
setCookie(cookies)
removeCookie(domain)
It uses
like
condition (%domain%
) so anything matching the pattern will be removed
Same APIs are available for all the browsers
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