fix(server/session): Attach closed to the instance.
Merge pull request #303 from codio/session_fixes

Some fixes for the session code.