Added auto login feature

Add autologin feature.