
Security News
CISA Kills Off RSS Feeds for KEVs and Cyber Alerts
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
github.com/10clouds/cyclejs-cookie
Cycle.js Cookie Driver, based on cookie_js library.
$ npm install --save cyclejs-cookie xstream
import xs from 'xstream';
import {run} from '@cycle/xstream-run';
import {makeCookieDriver} from 'cyclejs-cookie';
function main({cookie}) {
const cookieChangeSource$ = xs.periodic(1000);
const cookieValue$ = cookie.get('MyCookie');
// just for print debug
const noop = () => undefined;
cookieValue$.debug('cookie current value').addListener({
next: noop,
error: noop,
complete: noop,
});
return {
cookie: cookieChangeSource$.map((counter) => ({
key: 'MyCookie',
value: 'cookieValue-' + counter,
settings: {
expires: 30, // expiring in 30 days
}
}))
};
};
run(main, {
cookie: makeCookieDriver()
});
Library export only one function: makeCookieDriver
Instantiates an new cookie driver function (cookieDriver(sink$)).
decode
- set cookie.decode
attribute, check cookie_js documentation for details.$sink
- driver assumes that sink$ is stream of cookie setter objects. it interprete cookie setter object and set new cookie (or delete if cookie value is undefined).
Returning cookies observables functions object {get(), all()}
.
get(cookieName)
- returning stream of cookie cookieName
changes, initiated by current cookie valueall()
- returning stream of all cookies object changes, initiated by starting cookies objectDriver assumes following objects on it $sink:
{
key: 'cookieName',
value: 'cookieValue', // if undefined, cookie will be deleted
options: {..}
}
Options is cookie settings, like expires time. By cookie_js documentation:
The following fields can be added to the mentioned object:
key | value | default value |
---|---|---|
expires | Either a number containing the days until the expiry, a date in the GMTString format or a date object . | Expires when the browser is closed. |
domain | A string that specifies the domain that can access the cookie. | The current domain. |
path | A string that limits the access of the cookie to that path. | The current path. |
secure | A boolean indicating whether the cookie shall only be accessable over a secure connection or not. | false |
FAQs
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.