socketstream/socketstream — Issue #124: Sharing the same session between HTTP and WebSocket requests
Author: nponeccop
Created: 2012-01-26 19:08:33+00:00
State: open

If you remember, session support was important for me: see #86

Now it seems you ship 2.0.0alpha1 pre-release version of `connect` to provide sessions. However, I tried in many ways but couldn't make it working. I need either `connect`-style or `express`-style routing for http requests.

Here is the `express` way, copy-pasted from the tour. Of course I also define a client but that's irrelevant:

```javascript
function routes(app)
{
app.get('/openid/verify', openid.verify)
app.get('/openid/authenticate', openid.authenticate)
app.get('/', function (req, res) {
console.log("user (routes):", req.session)
res.serve('main')}
)
}

var express = require('express');
var app = express.createServer();
routes(app)
app.stack = app.stack.concat(ss.http.middleware.stack)
server = app.listen(3000);
ss.start(server);
```

Here `openid.authenticate` doesn't have `session` property in `req`. The `connect`-way doesn't work either.