Response.Redirect 后cookie为null了
程序代码:
HttpCookieCollection cookies = Request.Cookies; DataRow dr = dt1.Rows[0]; string username = dr["username"].ToString().ToUpper(); //这里 Response.Cookies["huiyuan"]["huiyuanbianhao"] = username.Split('_')[0]; Session["huiyuanbianhao"] = username.Split('_')[0]; Response.Redirect("index.aspx");
跳转前 测试都还存在的
跳转后 Response.Cookies["huiyuan"]["huiyuanbianhao"] 为null