Fixed login and automatic login from tag