add logout link and solve the problem of infinite loop when refresh welcome page after login