Hi,
I got a problem where when a user click on log out button from the cms desk or cms site manager, user is redirected to home page but still is logged in.
I have customized the code
/cmsdesk/header.aspx.cs
where the method below is the original,
protected void btnSignOut_Click(object sender, EventArgs e)
{
// Usual sign out
string signOutUrl = URLHelper.ApplicationPath.TrimEnd('/') + "/default.aspx";
// LiveID sign out URL is set if this is LiveID session
SignOut(ref signOutUrl);
ltlScript.Text += ScriptHelper.GetScript("parent.location.replace('" + signOutUrl + "');");
}
I have customized it to point to another page called KenticoSignOut.aspx
protected void btnSignOut_Click(object sender, EventArgs e)
{
// Usual sign out
string signOutUrl = URLHelper.ApplicationPath.TrimEnd('/') + "/KenticoSignOut.aspx";
// LiveID sign out URL is set if this is LiveID session
//SignOut(ref signOutUrl);
ltlScript.Text += ScriptHelper.GetScript("parent.location.replace('" + signOutUrl + "');");
}
In my KenticoSignOut.aspx.cs (placed on the root folder of the website), I have
protected void Page_Load(object sender, EventArgs e)
{
FormsAuthentication.SignOut();
CMSContext.CurrentUser = null;
Response.Cache.SetNoStore();
Response.Redirect("~/default.aspx");
}
Somehow, despite the code in KenticoSignOut.aspx.cs run, but it didn't work as expected.
Sometimes user still remain logged in.
Is there something I'm missing?
Thanks.