请问我能不能根据不同的人来设置不同的session时间,比如A登录session时间是5  B登录session时间是20  C登录session时间是50 D登录session时间是80等等
具体的怎么设置?

解决方案 »

  1.   

    可以的,在登陆session赋值的时候顺便session.Timeout = ...
      

  2.   

    你可以用Session数组。
    或用不同的Session变量名。。
      

  3.   

    你可以用Session数组。
    或用不同的Session变量名。。
      

  4.   

                string usn = this.txtName.Text;
                string pwd = FormsAuthentication.HashPasswordForStoringInConfigFile(this.txtPwd.Text, "MD5");
                this.Session["Adminlogin"] = usn;
                if(你想怎么整就怎么整吧!!){
                this.Session.Timeout = 50;
                }
      

  5.   

    switch (Session["uname"].ToString())
    case "A":
       HttpCookie newCookie = new HttpCookie("key", "value);
       newCookie.Expires = DateTime.Now.AddDays(5);
       HttpContext.Current.Response.Cookies.Add(newCookie);
      

  6.   

    switch (Session["uname"].ToString()) 
    case "A": 
           this.Session.Timeout = 50; 
    搞错了,我以为是cookie