"default.aspx",
"index.html",
"index.htm" };
-#if NET_4_0
public static TimeSpan Timeout {
get; private set;
}
if (!String.IsNullOrEmpty (value))
default_url = value;
}
-#endif
public FormsAuthentication ()
{
}
DateTime now = DateTime.Now;
DateTime then;
- if (createPersistentCookie)
- then = now.AddYears (50);
- else
- then = now.AddMinutes (timeout);
+ if (createPersistentCookie)
+ then = now.AddMinutes(timeout);
+ else
+ then = DateTime.MinValue;
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket (1,
userName,
now,
- then,
+ createPersistentCookie?then:now.AddYears (50),
createPersistentCookie,
String.Empty,
cookiePath);
- if (!createPersistentCookie)
- then = DateTime.MinValue;
-
HttpCookie cookie = new HttpCookie (cookieName, Encrypt (ticket), strCookiePath, then);
if (requireSSL)
cookie.Secure = true;
FormsAuthenticationConfiguration config = section.Forms;
cookieName = config.Name;
-#if NET_4_0
Timeout = config.Timeout;
-#endif
timeout = (int)config.Timeout.TotalMinutes;
cookiePath = config.Path;
protection = config.Protection;
cookie_domain = config.Domain;
cookie_mode = config.Cookieless;
cookies_supported = true; /* XXX ? */
-#if NET_4_0
if (!String.IsNullOrEmpty (default_url))
default_url = MapUrl (default_url);
else
-#endif
default_url = MapUrl(config.DefaultUrl);
enable_crossapp_redirects = config.EnableCrossAppRedirects;
-#if NET_4_0
if (!String.IsNullOrEmpty (login_url))
login_url = MapUrl (login_url);
else
-#endif
login_url = MapUrl(config.LoginUrl);
initialized = true;