Compartir a través de


HttpCookie Class

Definition

An HttpCookie object represents an HTTP cookie, which carries state information between server and user agent.

[Android.Runtime.Register("java/net/HttpCookie", DoNotGenerateAcw=true)]
public sealed class HttpCookie : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.Lang.ICloneable
[<Android.Runtime.Register("java/net/HttpCookie", DoNotGenerateAcw=true)>]
type HttpCookie = class
    inherit Object
    interface ICloneable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
HttpCookie
Attributes
Implements

Remarks

An HttpCookie object represents an HTTP cookie, which carries state information between server and user agent. Cookie is widely adopted to create stateful sessions.

There are 3 HTTP cookie specifications: <blockquote> Netscape draft<br> RFC 2109 - http://www.ietf.org/rfc/rfc2109.txthttp://www.ietf.org/rfc/rfc2109.txt<br> RFC 2965 - http://www.ietf.org/rfc/rfc2965.txthttp://www.ietf.org/rfc/rfc2965.txt</blockquote>

HttpCookie class can accept all these 3 forms of syntax.

Added in 1.6.

Java documentation for java.net.HttpCookie.

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.

Constructors

HttpCookie(String, String)

Constructs a cookie with a specified name and value.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Comment

Returns the comment describing the purpose of this cookie, or null if the cookie has no comment. -or- Specifies a comment that describes a cookie's purpose.

CommentURL

Returns the comment URL describing the purpose of this cookie, or null if the cookie has no comment URL. -or- Specifies a comment URL that describes a cookie's purpose.

Discard

Returns the discard attribute of the cookie -or- Specify whether user agent should discard the cookie unconditionally.

Domain

Returns the domain name set for this cookie. -or- Specifies the domain within which this cookie should be presented.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasExpired

Reports whether this HTTP cookie has expired or not.

HttpOnly

Returns true if this cookie contains the HttpOnly attribute. -or- Indicates whether the cookie should be considered HTTP Only.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
MaxAge

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

Name

Returns the name of the cookie.

Path

Returns the path on the server to which the browser returns this cookie. -or- Specifies a path for the cookie to which the client should return the cookie.

PeerReference (Inherited from Object)
Portlist

Returns the port list attribute of the cookie -or- Specify the portlist of the cookie, which restricts the port(s) to which a cookie may be sent back in a Cookie header.

Secure

Returns true if sending this cookie should be restricted to a secure protocol, or false if the it can be sent using any protocol. -or- Indicates whether the cookie should only be sent using a secure protocol, such as HTTPS or SSL.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
Value

Returns the value of the cookie. -or- Assigns a new value to a cookie after the cookie is created.

Version

Returns the version of the protocol this cookie complies with. -or- Sets the version of the cookie protocol this cookie complies with.

Methods

Clone()

Create and return a copy of this object.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
DomainMatches(String, String)

The utility method to check whether a host name is in a domain or not.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
Parse(String)

Constructs cookies from set-cookie or set-cookie2 header string.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to