When someone logs into my application and they checked the "Remember Me" checkbox, I set the createPersistentCookie = true
so that when they come back they don't need to log in again. However, occassionally, I need to use the FormsAuthentication.SetAuthCookie(NewUserName, [true/false])
so how do I know if they originally set the createPersistentCookie
to true or not so I can keep it the same as it was when they logged in?
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- How to store image outside of the website's ro
- 'System.Threading.ThreadAbortException' in
- Request.PathInfo issues and XSS attacks
- How to dynamically load partial view Via jquery aj
相关文章
- asp.net HiddenField控件扩展问题
- asp.net HiddenField控件扩展问题
- Asp.Net网站无法写入错误日志,测试站点可以,正是站点不行
- asp.net mvc 重定向到vue hash字符串丢失
- FormsAuthenticationTicket expires too soon
- “Dynamic operations can only be performed in homog
- What is the best way to create a lock from a web a
- Add to htmlAttributes for custom ActionLink helper
I believe when you decrypt the cookie you should be left with a
FormsAuthenticationTicket
which you can then query theIsPersistent
property.To decrypt:
References: FormsAuthentication.Decrypt() on MSDN
You should also remember to set in your application's web.config to constant value. ASP.NET has tendency to auto generate this values after some time.
For more info please take look at: http://msdn.microsoft.com/en-us/library/w8h3skw9(v=VS.90).aspx