title: How can we block the redirection to the home screen from the Azure ad logout screen?
body: <p>After the application Sign-out, the <strong>back button click will redirect the user back to the home screen of the application</strong>.
  How can we block the redirection to the home screen from the Azure ad logout screen?</p>
  <ul>
  <li>Application : .NET MVC 5</li>
  <li>Framework : 4.6.1</li>
  </ul>
  <p>Please find the Sign out function below:</p>
  <pre><code>public void SignOut()
          {
              HttpContext.GetOwinContext().Authentication.SignOut(OpenIdConnectAuthenticationDefaults.AuthenticationType, CookieAuthenticationDefaults.AuthenticationType);
            
              if (Request.Cookies[&quot;MyCookie&quot;] != null)
              {
                  var c = new HttpCookie(&quot;MyCookie&quot;);
                  c.Expires = DateTime.Now.AddDays(-1);
                  Response.Cookies.Add(c);
              }
              if (HttpContext.Request.Cookies[&quot;.AspNet.ApplicationCookie&quot;] != null)
              {
                  var c = new HttpCookie(&quot;.AspNet.ApplicationCookie&quot;);
                  c.Expires = DateTime.Now.AddDays(-1);
                  Response.Cookies.Add(c);
              }
  
              if (HttpContext.Request.Cookies[&quot;__RequestVerificationToken&quot;] != null)
              {
                  var c = new HttpCookie(&quot;__RequestVerificationToken&quot;);
                  c.Expires = DateTime.Now.AddDays(-1);
                  Response.Cookies.Add(c);
              }
              EndSession();
              Session.Abandon();
              AppSession.Clear();
          }
  
  
  public void EndSession()
          {
              Request.GetOwinContext().Authentication.SignOut();
              Request.GetOwinContext().Authentication.SignOut(Microsoft.AspNet.Identity.DefaultAuthenticationTypes.ApplicationCookie);
              this.HttpContext.GetOwinContext().Authentication.SignOut(CookieAuthenticationDefaults.AuthenticationType);
          }
  </code></pre>