Updated logout/login
Updated logout handling.