senchalabs/connect — pull request #569 by eknkc (2012-05-17 14:48:07+00:00)
Title: Set session cookie only when the cookie is updated

Hey, took the liberty to change some stuff in session tests and added cookie hash function. Check if it is ok..

* New hash function only uses cookie data to compute hash.
* isNew check added to ensure that a new session gets a cookie.
* Updated tests
* `should only set-cookie when modified` for the topic itself
* I also renamed sid helper function to signedSid as it's the bare cookie including sha256 signature and replaced sid with one that actually parses session ID itself to avoid confusion.
* Made modifications to tests using sid to use signedSid

Fixes Issue #568