Added append_sid calls to all redirects to prevent login loss after successful login.