HttpCookie.Expires プロパティ

定義

Cookie の有効期限の日付と時刻を取得または設定します。

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

プロパティ値

Cookie の有効期限が切れる時刻 (クライアント上)。

次のコード例では、Cookie の有効期限を現在の時刻から 10 分に設定します。

MyCookie.Expires = DateTime.Now.AddMinutes(10.0);
MyCookie.Expires = DateTime.Now.AddMinutes(10.0)

適用対象