注册 登录
编程论坛 ASP.NET技术论坛

Response.Redirect 后cookie为null了

等待冰柠檬 发布于 2010-05-08 13:24, 1623 次点击
程序代码:
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
0 回复
1