FormsAuthentication.SetAuthCookie
-
06-07-2019 - |
Question
hi we are using FormsAuthentication.SetAuthCookie(profile.Id, false);
Now the question is when does this cookie expires?
It of course expires once I close all the browsers but it doesn't I keep the browser open and I don't know the timelimit.
Solution
It will depend on the Timeout property in web.config.
OTHER TIPS
In the system.web attribute of your web.config file, you must set the following:
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
then your cookie will expire depending on the value you have set in the timeout attribute.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow