Skip to content

Instantly share code, notes, and snippets.

@mrichman
Created June 1, 2009 13:33
Show Gist options
  • Save mrichman/121403 to your computer and use it in GitHub Desktop.
Save mrichman/121403 to your computer and use it in GitHub Desktop.
protected void Session_Start(Object sender, EventArgs e)
{
Session["LoggedIn"] = false;
if (!Context.Request.Path.Contains("CreateSession.aspx"))
{
Session.Abandon();
Session.Clear();
Context.Response.StatusCode = 401;
Context.Response.StatusDescription = "Unauthorized";
Context.Response.End();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment