protected void SignDown() { if (HiddenField_Token.Value != (string)Session["sessinID"]) { throw new InvalidOperationException("Cross-Site Request Forgery (CSRF)"); } SessionsData sessions = new SessionsData(MapPath(".")); UsersData users = new UsersData(MapPath(".")); if (!sessions.IsValidSession((string)Session["sessionID"], (string)Session["userID"])) { throw new InvalidOperationException("The session is invalid."); } sessions.RemoveSession((string)Session["sessionID"]); users.RemoveUser((string)Session["userID"]); Session.Abandon(); }
public static void ForceSignOut(string currentPath, System.Web.SessionState.HttpSessionState session) { SessionsData sessions = new SessionsData(currentPath); sessions.RemoveSession((string)session["sessionID"]); session.Abandon(); }