using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.SessionState; namespace Itlead.Architecture.WebUI.tools { /// /// Loginout 的摘要说明 /// public class Loginout : IHttpHandler, IRequiresSessionState { public void ProcessRequest(HttpContext context) { context.Response.Expires = 0; context.Response.CacheControl = "no-cache"; context.Response.AddHeader("Pragma", "No-Cache"); context.Response.ContentType = "text/plain"; HttpCookie cookie = context.Response.Cookies["user"]; context.Session.Clear(); if (cookie != null) { cookie.Expires = DateTime.Now.AddDays(-1); context.Response.AppendCookie(cookie); } context.Response.Write("success"); // context.Response.Write("Hello World"); } public bool IsReusable { get { return false; } } } }