Formatting fixes
Formatting fix + checking user is empty before trying to set a session key with it
Merge pull request #2 from andytait/master

Tidied up formatting, removed whitespace and checked the user model was not empty before trying to get its ID for setting a session key