senchalabs/connect — pull request #776 by lpinca (2013-04-03 10:16:35+00:00)
Title: session: simplify the conditions used to prevent set-cookie

The `originalId == req.session.id` condition is equivalent to `!isNew`.
So the former is redundant and can be replaced by the latter.

Now the conditions used to prevent set-cookie require `!isNew`, so we can put them under the common condition `!isNew`.

The conditions could be further simplified to something like this:

```javascript
if (!isNew && (cookie.hasLongExpires
|| null === cookie.expires
|| originalHash == hash(req.session))) {
return debug('already set cookie');
}
```