senchalabs/connect — pull request #447 by troyk (2011-12-29 18:21:32+00:00)
Title: master: utils.unsign does not extract the sign correctly if the value contains a period

Using signed cookie sessions that happen to store a users email address and the cookie value on next request would be reset because the sign would fail, as unsign calls val.split('.') and only uses the first returning array item.

To fix, I considered re-joining on length > 2 or a regex, but thought a slice with lastIndexOf would ultimately be faster, although I'm new to hard core js hacking and don't have a fast way to bench this and prove my assumption, so hopefully I'm making an ass of nobody ;)

Tests included