Created
October 30, 2011 15:32
Revisions
-
nanodeath created this gist
Oct 30, 2011 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ {MemoryStore} = require('connect').session sessionStore = new MemoryStore app.configure -> app.use express.session({secret: "my_super_secret", store: sessionStore}) This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ app.configure -> # ... app.use express.session({secret: "my_super_secret"}) # ... This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ everyone.now.playerJoined = () -> sid = unescape(@user.cookie["connect.sid"]) # you DO have to unescape the session id! sessionStore.get(sid, (err, sess) -> console.log("That player who joined? his userId is #{sess.userId}") )