Skip to content

Instantly share code, notes, and snippets.

@steliodibello
Created April 19, 2020 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steliodibello/5e3ace22ced70014b39a507645dba192 to your computer and use it in GitHub Desktop.
Save steliodibello/5e3ace22ced70014b39a507645dba192 to your computer and use it in GitHub Desktop.
<script runat="server">
//This snippet goes into sitecore/login/default.aspx
protected override void OnPreInit(EventArgs e)
{
if (Request.Cookies[".AspNet.Cookies"] != null)
{
//Force expiration of SSO cookie on .yourclient.com domain
HttpCookie myCookie = new HttpCookie(".AspNet.Cookies");
myCookie.Expires = DateTime.Now.AddDays(-1d);
myCookie.Domain = "yourclient.com"; // !!!!
Response.Cookies.Add(myCookie);
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment