Only redirect to referer on login/logout if there is one