FormsAuthentication.RedirectFromLoginPage(TextBox1.Text,false);
为什么没有在本地生成cookies

解决方案 »

  1.   

    FormsAuthentication.RedirectFromLoginPage(TextBox1.Text,true);
    就会生成这是什么原因呀 
      

  2.   

    FormsAuthenticationTicket ft=new FormsAuthenticationTicket(TextBox1.Text,true,1);
    string st=FormsAuthentication.Encrypt(ft);
    Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName,st));
    Response.Redirect(FormsAuthentication.GetRedirectUrl(TextBox1.Text,true));
    我这样写为什么还是没有的
      

  3.   

    C# 
    public static void RedirectFromLoginPage (
    string userName,
    bool createPersistentCookie
    ) 参数
    userName
    经过身份验证的用户名。 createPersistentCookie
    若要创建持久 Cookie(跨浏览器会话保存的 Cookie),则为 true;否则为 false。
    详情请参照MSDN