使用 Response.Redirect(FormsAuthentication.GetRedirectUrl(username, chkRememberMe.Checked));//可以读出UserData 但是记不住登录状态!即 chkRememberMe.Checked 记住登录无效 使用 FormsAuthentication.RedirectFromLoginPage(username, chkRememberMe.Checked); //可以记住登录状态,却读不出UserData! 登录方法,及相关帖子如下: http://social.microsoft.com/Forums/zh-CN/295/thread/08bcbce6-e59a-4362-ae5c-3e6bbd962e8e protected void BtnLogin_Click(object sender, EventArgs e) { string username = this.TxtUserName.Text; if (username.EndsWith("lkf", StringComparison.InvariantCultureIgnoreCase) && TxtUserPwd.Text.EndsWith("lkf", StringComparison.InvariantCultureIgnoreCase)) { FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, username,DateTime.Now,DateTime.Now.AddMinutes(30), true, "admin|reader|editor", FormsAuthentication.FormsCookiePath ); string encTicket = FormsAuthentication.Encrypt(ticket); Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, encTicket)); Response.Redirect(FormsAuthentication.GetRedirectUrl(username, chkRememberMe.Checked));//可以读出UserData 但是记不住登录状态! //FormsAuthentication.RedirectFromLoginPage(username, chkRememberMe.Checked); //可以记住登录状态,却读不出UserData! } else { Response.Write("密码不正确"); } }