This documentation is archived and is not being maintained.

FormsAuthentication.RenewTicketIfOld Method

Conditionally updates the sliding expiration on a FormsAuthenticationTicket.

[Visual Basic]
Public Shared Function RenewTicketIfOld( _
   ByVal tOld As FormsAuthenticationTicket _
) As FormsAuthenticationTicket
public static FormsAuthenticationTicket RenewTicketIfOld(
 FormsAuthenticationTicket tOld
public: static FormsAuthenticationTicket* RenewTicketIfOld(
 FormsAuthenticationTicket* tOld
public static function RenewTicketIfOld(
   tOld : FormsAuthenticationTicket
) : FormsAuthenticationTicket;


The authentication ticket to update.

Return Value

The updated FormsAuthenticationTicket.


The ticket is updated with the IssueDate property set to the current time and the Expiration property based on the difference between the previous expiration time and the previous issue time. The ticket will be updated if the current date and time minus IssueDate is greater than the expiration date minus the current date and time [(DateTime.Now - IssueDate) > (Expiration - DateTime.Now)].


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

FormsAuthentication Class | FormsAuthentication Members | System.Web.Security Namespace