Export (0) Print
Expand All

FormsAuthentication.SlidingExpiration Property

Gets a value indicating whether sliding expiration is enabled.

Namespace: System.Web.Security
Assembly: System.Web (in system.web.dll)

public:
static property bool SlidingExpiration {
	bool get ();
}
/** @property */
public static boolean get_SlidingExpiration ()

public static function get SlidingExpiration () : boolean

Not applicable.

Property Value

true if sliding expiration is enabled; otherwise, false. The default is true.

The SlidingExpiration property value is set using the slidingExpiration attribute of the forms configuration element.

Sliding expiration resets the expiration time for a valid authentication cookie if a request is made and more than half of the timeout interval has elapsed. If the cookie expires, the user must re-authenticate. Setting the SlidingExpiration property to false can improve the security of an application by limiting the time for which an authentication cookie is valid, based on the configured timeout value.

We recommend that if you configure requireSSL as false, you also configure slidingExpiration as false, to reduce the amount of time for which a ticket is valid.

The following code example sets the slidingExpiration attribute to false in the Web.config file for an ASP.NET application.

<authentication mode="Forms">
  <forms loginUrl="member_login.aspx"
    name=".ASPXFORMSAUTH"
    cookieless="UseCookies"
    requireSSL="true" 
    slidingExpiration="false" />
</authentication>

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1

Community Additions

ADD
Show:
© 2014 Microsoft