在我的按钮点击事件中,我写了
//delete session cookie
Session.Abandon();
Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));
Request.Cookies.Get("ASP.NET_SessionId");
//create new sessionID
SessionIDManager manager = new SessionIDManager();
manager.RemoveSessionID(System.Web.HttpContext.Current);
var newId = manager.CreateSessionID(System.Web.HttpContext.Current);
var isRedirected = true;
var isAdded = true;
manager.SaveSessionID(System.Web.HttpContext.Current, newId, out isRedirected, out isAdded);
Session["id"]=21;
Response.Redirect("cc.aspx");
在cc.aspx页面加载上我写的是这样的,
int sss_id = (int)Session["id"];
但是我将sss_id的值设为null而不是geeting'21'。请帮忙