用户登陆控件的问题在线等
FormsAuthentication.Initialize();
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
2, // version
txtId.Text, // get the username
DateTime.Now, // issue time is now
DateTime.Now.AddMinutes(10), // expires in 10 minutes
false, // cookie is not persistent
authority); // role assignment is stored in the UserData
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName ,FormsAuthentication.Encrypt(ticket));
Response.Cookies.Add(cookie);
这是用户登录的代码
FormsAuthentication.SignOut();
这是用户注销的代码
我都是把它放到用户控件中
登陆后我显示的时候是取cookie得值显示
可是跳到有些页面的时候就显示不出来用户信息了
还有注销了以后有的页面还是显示以前的用户信息在控件上
不知道怎么解决
请高手指点