AnonymousIdentificationSection.CookieTimeout 属性

定义

获取或设置时间量(以分钟为单位),经过该时间间隔后身份验证便会过期。Gets or sets the amount of time, in minutes, after which the authentication expires.

public:
 property TimeSpan CookieTimeout { TimeSpan get(); void set(TimeSpan value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanMinutesOrInfiniteConverter))]
[System.Configuration.ConfigurationProperty("cookieTimeout", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
[System.Configuration.TimeSpanValidator(MaxValueString="10675199.02:48:05.4775807", MinValueString="00:00:00")]
public TimeSpan CookieTimeout { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.TimeSpanMinutesOrInfiniteConverter))>]
[<System.Configuration.ConfigurationProperty("cookieTimeout", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
[<System.Configuration.TimeSpanValidator(MaxValueString="10675199.02:48:05.4775807", MinValueString="00:00:00")>]
member this.CookieTimeout : TimeSpan with get, set
Public Property CookieTimeout As TimeSpan

属性值

TimeSpan

时间量(以分钟为单位),经过该时间间隔后身份验证便会过期。The amount of time, in minutes, after which the authentication expires. 默认值为100000。The default value is 100000.

属性

示例

下面的代码示例演示如何访问 CookieTimeout 属性。The following code example shows how to access the CookieTimeout property.

// Get CookieTimeout.
TimeSpan cookieTimeout =
    anonymousIdentificationSection.CookieTimeout;
Console.WriteLine("Cookie timeout: {0}",
    cookieTimeout.ToString());
' Get CookieTimeout.
Dim cookieTimeout As TimeSpan = _
anonymousIdentificationSection.CookieTimeout
Console.WriteLine( _
"Cookie timeout: {0}", cookieTimeout.ToString())

注解

此属性可以设置为任意大的值,但在内部, CookieTimeout 该值限制为最大值(两年)。This property can be set to an arbitrarily large value, but internally the CookieTimeout value is limited to a maximum value of two years.

适用于