Implemented autologin and autoregistration (close #96, close #97)