万分火急:cookie的问题,大家帮帮忙
string redirectURL;
redirectURL = FormsAuthentication.GetRedirectUrl(userName, false);
//创建 Cookie
FormsAuthentication.SetAuthCookie(userName, false);
//检索Cookie
string cookieName = FormsAuthentication.FormsCookieName;
HttpCookie c = Response.Cookies[cookieName];
//一旦加入了这句就不会跳转!!!!!!!!!!!!!!
Response.Cookies[cookieName].Values.Add( "class ",userclass);
Response.AppendCookie(c);
if (minutes != 0)
{
c.Expires = DateTime.Now.AddMinutes(minutes);
}
else
{
}
//重定向
Response.Redirect(redirectURL);
一旦加入了这句就不会跳转
Response.Cookies[cookieName].Values.Add( "class ",userclass);
Response.AppendCookie(c);
------解决方案--------------------用
Response.wirte(javascript)