Bugfixes to login, updated comments, user type

Login was passing in an incorrect substring (2 instead of 1). Added user
type to session variables.