Attach a cookie id to a Derby JS app's browser session. Works in both the client and server, so that you can track compiled derby apps that start offline. This is useful for logging, tracking errors on devices, etc.
npm install derby-cookie-tracker --save
var derby = require('derby');
var cookieTracker = require('derby-cookie-tracker');
var app = derby.createApp('app', __filename);
app.use(cookieTracker())
If you mutate the cookie id the module will update your browser cookie. i.e.:
model.set('$cookie.id', 'foo');
// document.cookie "$cookie.id=foo"
path - Where to store the cookie id. Defaults to $cookie.id
;
This cookie is not httpOnly and isn't secure. It shouldn't be used as a session id or to access private data.