Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
cookies library for node.js with dynamic cookies support
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.md
cookie-dyn.js
package.json

README.md

cookie-dyn

cookies library for node.js with dynamic cookies support

example:

var http = require('http');
var cookie = require('cookie-dyn');
var server = http.Server(function(req, res)
{
    var expires = new Date(new Date().getTime()+86409000).toUTCString();

    var c = new cookie(
    {
        req: req,
        res: res
    });

    c.set(
    {
        name:       'user',
        value:      'źital',
        expires:    expires,
        callback:   function()
        {
            console.log('set: user -> zital');
        }
    });

    c.setSync(
    {
        name: 'userSync',
        value: 'zital'
    });
    console.log('set: userSync -> zital');

    c.get(
    {
        name: 'user',
        callback: function(params)
        {
            console.log("get: user -> "+params['result']);
        }
    });

    console.log("get: userSync -> "+ c.getSync(
    {
        name: 'userSync'
    }));

    c.remove(
    {
        name: 'user',
        callback: function(params)
        {
            console.log('remove: user');
        }
    });
    c.removeSync({name: 'userSync'});
    console.log('remove: userSync');

    res.end('watch: Firebug -> Cookies');
});
server.listen(8000);

Something went wrong with that request. Please try again.