Hi Ivana,
Here is the code that is being run:
protected void btnSignOut_Click(object sender, EventArgs e)
{
if (this.StopProcessing)
{
// Do not process
}
else
{
if (CMSContext.CurrentUser.IsAuthenticated())
{
FormsAuthentication.SignOut();
CMSContext.ClearShoppingCart();
string redirectUrl = this.RedirectToUrl;
// If the user has registered Windows Live ID
if (!String.IsNullOrEmpty(CMSContext.CurrentUser.UserSettings.WindowsLiveID))
{
// Get data from auth cookie
string[] userData = UserInfoProvider.GetUserDataFromAuthCookie();
// If user has logged in using Windows Live ID, then sign him out from Live too
if ((userData != null) && (Array.IndexOf(userData, "liveidlogin") >= 0))
{
string siteName = CMSContext.CurrentSiteName;
// Get LiveID settings
string appId = SettingsKeyProvider.GetStringValue(siteName + ".CMSApplicationID");
string secret = SettingsKeyProvider.GetStringValue(siteName + ".CMSApplicationSecret");
string algorithm = SettingsKeyProvider.GetStringValue(siteName + ".CMSsecurityAlgorithm");
// Check valid Windows LiveID parameters
if ((appId != string.Empty) && (secret != string.Empty) && (algorithm != string.Empty))
{
WindowsLiveLogin wll = new WindowsLiveLogin(appId, secret, algorithm);
if (Session != null)
{
// Store info about logout request, for validation logout request
Session["liveidlogout"] = DateTime.Now;
}
// Redirect to Windows Live
redirectUrl = wll.GetLogoutUrl();
}
}
}
CMSContext.CurrentUser = null;
Response.Cache.SetNoStore();
UrlHelper.Redirect(redirectUrl);
}
else
{
string returnUrl = null;
string signInUrl = null;
if (this.SignInUrl != "")
{
signInUrl = ResolveUrl(CMSContext.GetUrl(this.SignInUrl));
}
else
{
signInUrl = SettingsKeyProvider.GetStringValue(CMSContext.CurrentSiteName + ".CMSSecuredAreasLogonPage");
}
if (this.ReturnPath != "")
{
returnUrl = ResolveUrl(CMSContext.GetUrl(this.ReturnPath));
}
else
{
returnUrl = UrlHelper.CurrentURL;
}
if (signInUrl != "")
{
UrlHelper.Redirect(UrlHelper.AddParameterToUrl(signInUrl, "returnurl", returnUrl));
}
}
}
}
Where would Session.Abandon() sit?
Regards,
Derrick