Updated auto login functionality.

Updated auto login functionality.