HttpCookie.MaxAge Property

Definition

Returns the maximum age of the cookie, specified in seconds. -or- Sets the maximum age of the cookie in seconds.

public long MaxAge { [Android.Runtime.Register("getMaxAge", "()J", "")] get; [Android.Runtime.Register("setMaxAge", "(J)V", "")] set; }
[<get: Android.Runtime.Register("getMaxAge", "()J", "")>]
[<set: Android.Runtime.Register("setMaxAge", "(J)V", "")>]
member this.MaxAge : int64 with get, set

Property Value

an integer specifying the maximum age of the cookie in seconds

Attributes

Remarks

Property getter documentation:

Returns the maximum age of the cookie, specified in seconds. By default, -1 indicating the cookie will persist until browser shutdown.

Java documentation for java.net.HttpCookie.getMaxAge().

Property setter documentation:

Sets the maximum age of the cookie in seconds.

A positive value indicates that the cookie will expire after that many seconds have passed. Note that the value is the maximum age when the cookie will expire, not the cookie's current age.

A negative value means that the cookie is not stored persistently and will be deleted when the Web browser exits. A zero value causes the cookie to be deleted.

Java documentation for java.net.HttpCookie.setMaxAge(long).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to