private void Logout(bool redirect) { ConciergeAPI.ClearSession(); SessionManager.Set <object>("PortalLinks", null); // force portal link reload, so non-public links don't show var logoutUrl = ConciergeAPI.LogoutUrl; SessionManager.Clear(); if (redirect) { Response.Redirect(!string.IsNullOrWhiteSpace(logoutUrl) ? logoutUrl : "~/Login.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { ConciergeAPI.ClearSession(); SessionManager.Set <object>("PortalLinks", null); // force portal link reload, so non-public links don't show var logoutUrl = ConciergeAPI.LogoutUrl; SessionManager.Clear(); if (!string.IsNullOrWhiteSpace(NextUrl) && Uri.IsWellFormedUriString(NextUrl, UriKind.RelativeOrAbsolute)) { Response.Redirect(NextUrl); return; } if (!string.IsNullOrWhiteSpace(logoutUrl)) { Response.Redirect(logoutUrl); return; } Response.Redirect("~/Login.aspx"); }