Asp.net mvc 3 mvc3如何增加登录时间,我已经尝试过了,但还是错了
我一直在尝试延长每个登录用户的登录时间,但出于某种原因,在15到20分钟左右之后,我就会被注销。我想让注销时间达到300分钟,因为人们实际上在网站上创建文章,所以他们需要时间。到目前为止,我所拥有的是Asp.net mvc 3 mvc3如何增加登录时间,我已经尝试过了,但还是错了,asp.net-mvc-3,logout,form-authentication,Asp.net Mvc 3,Logout,Form Authentication,我一直在尝试延长每个登录用户的登录时间,但出于某种原因,在15到20分钟左右之后,我就会被注销。我想让注销时间达到300分钟,因为人们实际上在网站上创建文章,所以他们需要时间。到目前为止,我所拥有的是 // this is when users login i want the timeout to be 300 minutes automatically FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(m
// this is when users login i want the timeout to be 300 minutes automatically
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(model.Email, model.RememberMe, 300);
string encTicket = FormsAuthentication.Encrypt(ticket);
Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, encTicket));
这是我的web.config
<authentication mode="Forms">
<forms name=".loog" loginUrl="~/Account/login" timeout="300" protection="All" path="/" requireSSL="false" slidingExpiration="true" cookieless="AutoDetect"/>
</authentication>
我每20分钟注销一次的原因是什么。。任何帮助都会很好 试试这个
在web.config中
<system.web>
.......
<sessionState timeout="300"></sessionState>
</system.web>
.......
您是否使用ASP.NET会话来存储一些用户详细信息?不,我不是,我只是希望登录用户不会每隔20分钟被踢出一次。我会尝试一下,看看效果如何。