cookie serialization and parsing for node.js