Flotype / now

NowJS makes it easy to build real-time web apps using JavaScript
http://www.nowjs.com
MIT License
1.91k stars 175 forks source link

When will NowJS be able to read the response and request objects? #148

Closed felixchan closed 13 years ago

felixchan commented 13 years ago

It's really painful not to be able to access the user's session.

yuchi commented 13 years ago

Probably this link can help you to build a workaround and to probably propose an implementation for a simpler API to now.js. Remember to look also Update 2 and Update 3 where Justin Slattery implements the authenticated sockets.

ericz commented 13 years ago

@felixchan

You can access the session data by finding the connection sessionId:

var id = unescape(this.user.cookie['connect.sid']));

With which you can access the session date if you are using sessions in express.

ericz commented 13 years ago

Because of the different paradigm of request / response as opposed to realtime data communication, it's not possible to access the request/response object (as there is no concept of request or response). Use the technique above you can access the session data store.

Closing