出處:http://king971119.blogspot.tw/2010/02/generic-handler-ashx-session.html
using System.Web.SessionState;
public class Handler2 : IHttpHandler, IReadOnlySessionState{
public void ProcessRequest (HttpContext context) {
context.Response.ContentType = "text/plain";
context.Session.Add("XXX", 104);
context.Response.Write(context.Session["XXX"]);
}
public bool IsReusable {
get {
return false;
}
}
}