Adapted login/logout/register. I think.