Share via


LocalClientSecuritySettings.CookieRenewalThresholdPercentage 屬性

定義

取得或設定更新安全對話 Cookie 的臨界百分比。

public:
 property int CookieRenewalThresholdPercentage { int get(); void set(int value); };
public int CookieRenewalThresholdPercentage { get; set; }
member this.CookieRenewalThresholdPercentage : int with get, set
Public Property CookieRenewalThresholdPercentage As Integer

屬性值

更新安全對談 Cookie 的臨界百分比。 預設為 60%。

例外狀況

這個屬性設為小於 0 或大於 100 的值。set

範例

這個範例會說明如何設定 CookieRenewalThresholdPercentage 成員。

// Set to 20 minutes.
settings.CookieRenewalThresholdPercentage = 20;
' Set to 20 minutes.
settings.CookieRenewalThresholdPercentage = 20

備註

用戶端會快取安全對話 Cookie,而且當已快取的 Cookie 快要過期時,用戶端會自動從服務取得新的 Cookie。 這個屬性的值會決定已快取之 Cookie 的有效期間必須已超過多少百分比,才可以取得新的 Cookie。 例如,如果這個屬性的值是 60,而且用戶端有一個有效期為 100 分鐘的安全對話 Cookie,這時用戶端會重複使用該快取的 Cookie,過了 60 分鐘之後,再從服務取得新的 Cookie。

適用於