const getCookie = (options) => {
return new Promise((resolve, reject) => {
session.defaultSession.cookies.get(options, (error, cookie) => {
if (error) { reject(error);} else { resolve(cookie); }
});
})
}
try {
const cookie = await getCookie({url: 'http://localhost',name: 'active_account'});
...
} catch (e) {
...
}