我写的登录页面,用的是form验证。我在公司的电脑上试的可以,没有问题。
在家的电脑上,老是登录不上去。
家里电脑的IE安全设置的是中,隐私也是中。我写了个cookie进去,在读出来,也没问题。
是不是家里电脑还要进行什么设置?我的web.config
<authentication mode="Forms">
<forms name="XueHn" loginUrl="XHAdmin/Default.aspx" protection="All" />
</authentication>
登录时的程序。
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, UserName.Text.ToLower(), DateTime.Now, DateTime.Now.AddMinutes(60), false, UserName.Text.ToLower());//创建一个验证票据
string cookieStr = FormsAuthentication.Encrypt(ticket);
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, cookieStr);
Response.Cookies.Add(cookie);
Response.Redirect("Frame/Main.aspx");
在家的电脑上,老是登录不上去。
家里电脑的IE安全设置的是中,隐私也是中。我写了个cookie进去,在读出来,也没问题。
是不是家里电脑还要进行什么设置?我的web.config
<authentication mode="Forms">
<forms name="XueHn" loginUrl="XHAdmin/Default.aspx" protection="All" />
</authentication>
登录时的程序。
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, UserName.Text.ToLower(), DateTime.Now, DateTime.Now.AddMinutes(60), false, UserName.Text.ToLower());//创建一个验证票据
string cookieStr = FormsAuthentication.Encrypt(ticket);
HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, cookieStr);
Response.Cookies.Add(cookie);
Response.Redirect("Frame/Main.aspx");
解决方案 »
- wpf 求助
- 请问前台拖过来的这段ObjectDataSource的代码,在后台应该怎么写?
- 网站多语言本,除了国际化和数据库中指定语言标识。网上哪有机器自动翻译的接口或着啥的吖。
- 如何让页面中所有的按钮不可操作(不能点)!
- 关于在虚拟主机上使用sql
- pdf和jpg高级难题
- 我买了本书关于asp.net的书。。。不过。。。
- 如何把数据库中的值赋给row("姓名") 呢?,我不知道row("姓名"),1,2的值是如何从数据库中绑定到datagrid中的。那位再贴一段详细一点的代
- 自定义控件编码中如何得到引用本控件的实例名?
- 请教DataGird !!!
- 如编程建立Web应用程序,vs2003
- 谁能吧这个代码调试通 ,asp.net gdi+
http://www.cnblogs.com/luomingchao/articles/474674.html