Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tapestry5.services
Interface Cookies

All Known Implementing Classes:
  CookiesImpl

    public interface Cookies

Used by other services to obtain cookie values for the current request, or to write cookie values as part of the request. Note that when writing cookies, the cookie's secure flag will match `Request.isSecure()`.

Method Summary
`java.lang.String` | `readCookieValue(java.lang.String name)` Returns the value of the first cookie whose name matches.
`void` | `removeCookieValue(java.lang.String name)` Removes a previously written cookie, by writing a new cookie with a maxAge of 0.
`void` | `writeCookieValue(java.lang.String name, java.lang.String value)` Creates or updates a cookie value.
`void` | `writeCookieValue(java.lang.String name, java.lang.String value, int maxAge)` As with `writeCookieValue(String, String)` but an explicit maximum age may be set.
`void` | `writeCookieValue(java.lang.String name, java.lang.String value, java.lang.String path)` As with `writeCookieValue(String, String)` but an explicit path may be set.
`void` | `writeCookieValue(java.lang.String name, java.lang.String value, java.lang.String path, java.lang.String domain)` As with `writeCookieValue(String, String, String)` but an explicit domain and path may be set.
`void` | `writeDomainCookieValue(java.lang.String name, java.lang.String value, java.lang.String domain)` As with `writeCookieValue(String, String)` but an explicit domain may be set.
`void` | `writeDomainCookieValue(java.lang.String name, java.lang.String value, java.lang.String domain, int maxAge)` As with `writeCookieValue(String, String)` but an explicit domain and maximum age may be set.

Method Detail

### readCookieValue

    java.lang.String readCookieValue(java.lang.String name)

  Returns the value of the first cookie whose name matches. Returns null if no such cookie exists. This method is only aware of cookies that are part of the incoming request; it does not know about additional cookies added since then (via `writeCookieValue(String, String)`).

### writeCookieValue

    void writeCookieValue(java.lang.String name,
                          java.lang.String value)

  Creates or updates a cookie value. The value is stored using a max age (in seconds) defined by the symbol `org.apache.tapestry5.default-cookie-max-age`. The factory default for this value is the equivalent of one week.

### writeCookieValue

    void writeCookieValue(java.lang.String name,
                          java.lang.String value,
                          int maxAge)

  As with `writeCookieValue(String, String)` but an explicit maximum age may be set.

  Parameters:
    `name` - the name of the cookie
    `value` - the value to be stored in the cookie
    `maxAge` - the maximum age, in seconds, to store the cookie

### writeCookieValue

    void writeCookieValue(java.lang.String name,
                          java.lang.String value,
                          java.lang.String path)

  As with `writeCookieValue(String, String)` but an explicit path may be set.

### writeDomainCookieValue

    void writeDomainCookieValue(java.lang.String name,
                                java.lang.String value,
                                java.lang.String domain)

  As with `writeCookieValue(String, String)` but an explicit domain may be set.

### writeDomainCookieValue

    void writeDomainCookieValue(java.lang.String name,
                                java.lang.String value,
                                java.lang.String domain,
                                int maxAge)

  As with `writeCookieValue(String, String)` but an explicit domain and maximum age may be set.

### writeCookieValue

    void writeCookieValue(java.lang.String name,
                          java.lang.String value,
                          java.lang.String path,
                          java.lang.String domain)

  As with `writeCookieValue(String, String, String)` but an explicit domain and path may be set.

### removeCookieValue

    void removeCookieValue(java.lang.String name)

  Removes a previously written cookie, by writing a new cookie with a maxAge of 0.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2012 The Apache Software Foundation.