TicketCompatibilityMode TicketCompatibilityMode TicketCompatibilityMode TicketCompatibilityMode Enum

定义

定义在 Forms 身份验证中对于票证到期日期使用协调世界时 (UTC) 还是本地时间。Defines whether to use Coordinated Universal Time (UTC) or local time for the ticket expiration date for forms authentication.

public enum class TicketCompatibilityMode
public enum TicketCompatibilityMode
type TicketCompatibilityMode = 
Public Enum TicketCompatibilityMode
继承
TicketCompatibilityModeTicketCompatibilityModeTicketCompatibilityModeTicketCompatibilityMode

字段

Framework20 Framework20 Framework20 Framework20 0

指定将票证到期日期存储为本地时间。Specifies that the ticket expiration date is stored as local time. 这是默认值。This is the default value.

Framework40 Framework40 Framework40 Framework40 1

指定将票证到期日期存储为 UTC。Specifies that the ticket expiration date is stored as UTC.

示例

下面的示例将 forms 身份验证票证到期日期配置为 UTC 时间。The following example configures the forms authentication ticket expiration date as UTC time.

<system.web>  
  <authentication mode="Forms">   
    <forms ticketCompatibilityMode="Framework40">  
    </forms>  
  </authentication>  
</system.web>  

注解

可以使用协调世界时 (UTC) 或本地时间存储 ASP.NET forms 身份验证的票证到期日期。The ticket expiration date for ASP.NET forms authentication can be stored by using Coordinated Universal Time (UTC) or the local time. 为了实现应用程序之间的兼容性, 以及 .NET Framework 的不同版本之间的兼容性, 可以通过使用ticketCompatibilityMode元素的属性来指定票证到期时间。For compatibility between applications, and for compatibility between different versions of the .NET Framework, the ticket expiration time can be specified by using the ticketCompatibilityMode attribute of the element. ticketCompatibilityMode属性的默认值为 Framework20。The default value for the ticketCompatibilityMode attribute is Framework20.

适用于