开发者

Remember Me problem in ASP.NET MVC 2

开发者 https://www.devze.com 2023-01-11 01:22 出处:网络
Greetings. I have a problem with Remember Me possibility. It didn\'t remember my login. First of all I checked FormsAuthentication.SetAuthCookie( userName, createPersistentCookie ); in SignIn method.

Greetings. I have a problem with Remember Me possibility. It didn't remember my login. First of all I checked FormsAuthentication.SetAuthCookie( userName, createPersistentCookie ); in SignIn method. The second parameter is true if I checkbox is cheked. Also I've checked the cookie named .ASPXAUTH ( http://img412.imageshack.us/img412/3585/cookieb.png ). It expire开发者_高级运维s on a day about. But it's not works. If i try open web application after 10 minutes (for example), I will logged out. How can I fix it and how can I enlarge cookie lifetime?


Seems like you're using membership. Something like...

http://dotnetblogger.com/post/2010/01/11/ASPNET-Membership-Remember-Me-That-Actually-Works.aspx

should work.

Mostly, you need FormsAuthentication.RedirectFromLoginPage()

0

精彩评论

暂无评论...
验证码 换一张
取 消