login/logout function implemented