public class ServletCookie extends H.Cookie
Cookie to H.CookieH.Cookie.F| Constructor and Description |
|---|
ServletCookie(javax.servlet.http.Cookie cookie) |
| Modifier and Type | Method and Description |
|---|---|
static javax.servlet.http.Cookie |
asServletCookie(H.Cookie c) |
String |
domain()
Returns the domain of the cookie
|
ServletCookie |
domain(String domain)
Set the domain of the cookie
|
int |
maxAge()
Returns the maximum age of cookie specified in seconds.
|
ServletCookie |
maxAge(int maxAge)
Set the max age of the cookie in seconds.
|
String |
name()
Returns the name of the cookie.
|
static ServletCookie |
of(javax.servlet.http.Cookie c) |
String |
path()
Returns the path on the server
to which the browser returns this cookie.
|
ServletCookie |
path(String uri)
Specifies a path for the cookie
to which the client should return the cookie.
|
boolean |
secure()
Returns
true if the browser is sending cookies
only over a secure protocol, or false if the
browser can send cookies using any protocol. |
ServletCookie |
secure(boolean secure)
Indicates to the browser whether the cookie should only be sent
using a secure protocol, such as HTTPS or SSL.
|
String |
value()
Returns the value of the cookie
|
ServletCookie |
value(String value)
Set a value to a cookie and the return
this cookie |
public String name()
H.Cookiepublic ServletCookie value(String value)
H.Cookiethis cookiepublic String domain()
H.Cookiepublic ServletCookie domain(String domain)
H.Cookiepublic String path()
H.Cookiepath in class H.CookieH.Cookie.path(String)public ServletCookie path(String uri)
H.CookieThe cookie is visible to all the pages in the directory you specify, and all the pages in that directory's subdirectories.
Consult RFC 2109 (available on the Internet) for more information on setting path names for cookies.
path in class H.Cookieuri - a String specifying a pathH.Cookie.pathpublic int maxAge()
H.Cookie-1 then the cookie will persist until
browser shutdownpublic ServletCookie maxAge(int maxAge)
H.CookieA 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.
maxAge in class H.CookiemaxAge - the max age to be setH.Cookie.maxAge()public boolean secure()
H.Cookietrue if the browser is sending cookies
only over a secure protocol, or false if the
browser can send cookies using any protocol.secure in class H.CookieH.Cookie.secure(boolean)public ServletCookie secure(boolean secure)
H.CookieThe default value is false.
public static ServletCookie of(javax.servlet.http.Cookie c)
public static javax.servlet.http.Cookie asServletCookie(H.Cookie c)
Copyright © 2017. All Rights Reserved.