com.teamdev.jxbrowser.cookie
Class HttpCookie

java.lang.Object
  extended by com.teamdev.jxbrowser.cookie.HttpCookie

public class HttpCookie
extends java.lang.Object

Represents an HTTP cookie.


Constructor Summary
HttpCookie(java.lang.String name, java.lang.String value, java.lang.String domain, java.lang.String path, long expiresDate, boolean httpOnly, boolean secure, boolean sessionOnly)
           
 
Method Summary
 java.lang.String getDomain()
          Returns the domain of cookie.
 long getExpiresDate()
          Returns the cookie's expiration date.
 java.lang.String getName()
          Returns the cookie's name.
 java.lang.String getPath()
          Returns the cookie's path.
 java.lang.String getValue()
          Returns the cookie's value.
 boolean isHTTPOnly()
          Returns whether the cookie should only be sent to HTTP servers.
 boolean isSecure()
          Returns whether the cookie should only be sent over secure channels.
 boolean isSessionOnly()
          Returns whether the cookie should be discarded at the end of the session (regardless of expiration date).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpCookie

public HttpCookie(java.lang.String name,
                  java.lang.String value,
                  java.lang.String domain,
                  java.lang.String path,
                  long expiresDate,
                  boolean httpOnly,
                  boolean secure,
                  boolean sessionOnly)
Method Detail

getName

public java.lang.String getName()
Returns the cookie's name.

Returns:
the cookie's name.

getValue

public java.lang.String getValue()
Returns the cookie's value.

Returns:
the cookie's value.

getDomain

public java.lang.String getDomain()
Returns the domain of cookie.

If the domain does not start with a dot, then the cookie will only be sent to the exact host specified by the domain. If the domain does start with a dot, then the cookie will be sent to other hosts in that domain as well, subject to certain restrictions.

Returns:
the domain of cookie.

getPath

public java.lang.String getPath()
Returns the cookie's path.

The cookie will be sent with requests for this path in the cookie's domain, and all paths that have this prefix. A path of “/” means the cookie will be sent for all URLs in the domain.

Returns:
the cookie's path.

getExpiresDate

public long getExpiresDate()
Returns the cookie's expiration date.

The expiration date, or -1 if there is no specific expiration date such as in the case of “session-only” cookies. The expiration date is the date when the cookie should be deleted.

Returns:
the cookie's expiration date or -1 if there is no specific expiration date.

isHTTPOnly

public boolean isHTTPOnly()
Returns whether the cookie should only be sent to HTTP servers.

Cookies may be marked as HTTP only by a server (or by a javascript). Cookies marked as such must only be sent via HTTP Headers in HTTP requests for URL's that match both the path and domain of the respective cookies.

Returns:
true if this cookie should only be sent via HTTP headers, false otherwise.

isSessionOnly

public boolean isSessionOnly()
Returns whether the cookie should be discarded at the end of the session (regardless of expiration date).

Returns:
true if the cookie should be discarded at the end of the session (regardless of expiration date), otherwise false.

isSecure

public boolean isSecure()
Returns whether the cookie should only be sent over secure channels.

Returns:
true if this cookie should only be sent over secure channels, otherwise false.