Open micurs opened 9 years ago
To set a cookie:
var cookieSetter = {
name: 'cookieSetter',
onGet: function( q, response ) {
// create a cookie using any cookie library available on node and serialize it as cookieStr
this.setCookie( cookieStr );
this.ok(response);
}
};
To get cookies within the request:
var cookieGetter = {
name: 'cookieGetter',
onGet: function( q, response ) {
// retrieve all the cookies as an unparsed array of string
var cks: string[] = this.getCookies();
// parse the cookies with any available cookie library available on node ...
this.ok(response);
}
};
A resource handler should be able to set a cookie (in its response) and retrieve a cookie (in the incoming message).