<%@ WebHandler Language="C#" Class="GetSession" %>

using System;
using System.Web;
using LoadTemplate;
using HuiboBll;

public class GetSession : IHttpHandler, System.Web.SessionState.IRequiresSessionState
 {
    private string state = string.Empty;
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/plain";
        try
        {
            if (string.IsNullOrEmpty(context.Request.QueryString["type"]))
            {
                if (context.Session["ShopUser"] == null)
                    state = "false";
                else
                    state = "true";
            }
            else if (context.Request.QueryString["type"].ToString() == "exit")
            {
                context.Session["ShopUser"] = null;
                state = "ok";
            }
        }
        catch (Exception el) {
            state = el.Message.ToString();
        }
        context.Response.Write(state);
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}