Ejemplo n.º 1
0
    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");
        }
    }
Ejemplo n.º 2
0
    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");
    }