ptmccarthy/nodechat — pull request #34 by ptmccarthy (2014-06-07 00:31:10+00:00)
Title: Attach a character to a session closes #32

I split the character page to have both a "pick character" and a "create character" page.

The pick character page attaches the character (just the uuid) to your session.

I added another middleware function 'hasActiveCharacter' that will route you to pick_char if your session doesn't have a character attached to it.

An oddity I found in doing all this is that default Express session handling is a little bit wonky with cookies (I think). If you log out and then log back in without clearing your cookies, if you log back in your character is still attached. Using private browsing sessions doesn't seem to have this issue. Maybe there is some configuration to change this behavior.