GWT 2.7.0

## com.google.gwt.user.client
Class Cookies

    java.lang.Object
      com.google.gwt.user.client.Cookies

    public class Cookies

extends java.lang.Object

Provides access to browser cookies stored on the client. Because of browser restrictions, you will only be able to access cookies associated with the current page's domain.

Field Summary
`(package private) static java.util.HashMap<java.lang.String,java.lang.String>` | `cachedCookies` Cached copy of cookies.
`(package private) static java.lang.String` | `rawCookies` Raw cookie string stored to allow cached cookies to be invalidated on write.

Method Summary
`static java.lang.String` | `getCookie(java.lang.String name)` Gets the cookie associated with the given name.
`static java.util.Collection<java.lang.String>` | `getCookieNames()` Gets the names of all cookies in this page's domain.
`static boolean` | `getUriEncode()` Gets the URIencode flag.
`static boolean` | `isCookieEnabled()` Checks whether or not cookies are enabled or disabled.
`(package private) static void` | `loadCookies(java.util.HashMap<java.lang.String,java.lang.String> m)`
`static void` | `removeCookie(java.lang.String name)` Removes the cookie associated with the given name.
`static void` | `removeCookie(java.lang.String name, java.lang.String path)` Removes the cookie associated with the given name.
`static void` | `removeCookieNative(java.lang.String name, java.lang.String path)` Native method to remove a cookie with a path.
`static void` | `setCookie(java.lang.String name, java.lang.String value)` Sets a cookie.
`static void` | `setCookie(java.lang.String name, java.lang.String value, java.util.Date expires)` Sets a cookie.
`static void` | `setCookie(java.lang.String name, java.lang.String value, java.util.Date expires, java.lang.String domain, java.lang.String path, boolean secure)` Sets a cookie.
`static void` | `setUriEncode(boolean encode)` Updates the URIencode flag and empties the cached cookies set.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### cachedCookies

    static java.util.HashMap<java.lang.String,java.lang.String> cachedCookies

  Cached copy of cookies.

### rawCookies

    static java.lang.String rawCookies

  Raw cookie string stored to allow cached cookies to be invalidated on write.

Method Detail

### getCookie

    public static java.lang.String getCookie(java.lang.String name)

  Gets the cookie associated with the given name.

  Parameters:
    `name` - the name of the cookie to be retrieved
  Returns:
    the cookie's value, or `null` if the cookie doesn't exist

### getCookieNames

    public static java.util.Collection<java.lang.String> getCookieNames()

  Gets the names of all cookies in this page's domain.

  Returns:
    the names of all cookies

### getUriEncode

    public static boolean getUriEncode()

  Gets the URIencode flag.

### isCookieEnabled

    public static boolean isCookieEnabled()

  Checks whether or not cookies are enabled or disabled.

  Returns:
    true if a cookie can be set, false if not

### removeCookie

    public static void removeCookie(java.lang.String name)

  Removes the cookie associated with the given name.

  Parameters:
    `name` - the name of the cookie to be removed

### removeCookie

    public static void removeCookie(java.lang.String name,
                                    java.lang.String path)

  Removes the cookie associated with the given name.

  Parameters:
    `name` - the name of the cookie to be removed
    `path` - the path to be associated with this cookie (which should match the path given in `setCookie(java.lang.String, java.lang.String)`)

### removeCookieNative

    public static void removeCookieNative(java.lang.String name,
                                          java.lang.String path)

  Native method to remove a cookie with a path.

### setCookie

    public static void setCookie(java.lang.String name,
                                 java.lang.String value)

  Sets a cookie. The cookie will expire when the current browser session is ended.

  Parameters:
    `name` - the cookie's name
    `value` - the cookie's value

### setCookie

    public static void setCookie(java.lang.String name,
                                 java.lang.String value,
                                 java.util.Date expires)

  Sets a cookie.

  Parameters:
    `name` - the cookie's name
    `value` - the cookie's value
    `expires` - when the cookie expires

### setCookie

    public static void setCookie(java.lang.String name,
                                 java.lang.String value,
                                 java.util.Date expires,
                                 java.lang.String domain,
                                 java.lang.String path,
                                 boolean secure)

  Sets a cookie. If uriEncoding is false, it checks the validity of name and value. Name: Must conform to RFC 2965. Not allowed: = , ; white space. Also can't begin with $. Value: No = or ;

  Parameters:
    `name` - the cookie's name
    `value` - the cookie's value
    `expires` - when the cookie expires
    `domain` - the domain to be associated with this cookie
    `path` - the path to be associated with this cookie
    `secure` - `true` to make this a secure cookie (that is, only accessible over an SSL connection)

### setUriEncode

    public static void setUriEncode(boolean encode)

  Updates the URIencode flag and empties the cached cookies set.

### loadCookies

    static void loadCookies(java.util.HashMap<java.lang.String,java.lang.String> m)

GWT 2.7.0