socketstream/socketstream — pull request #127 by nponeccop (2012-02-01 12:53:44+00:00)
Title: Sharing the same session between HTTP and WebSocket requests

The patch is a reimplementation of #89 for socketstream-0.3. See also discussions at #86 and #124

The changes are:

* connect-redis is used to store sessions in redis by Connect
* `connect.session` middleware parameters are changed so session cookies are accessible from browser Javascript
* socketstream redis store uses `setex` instead of `set` so sessions are not stored in redis forever
* socketstream redis store uses the same key format as connect-redis
* session cache variable was removed as it caused memory leaks because sessions were cached in memory forever
* socketstream doesn't create sessions but only uses sessions created by Connect
* a bug in evented router was fixed so it doesn't infinitely loop on unknown urls

What do you think?