public class CookieImpl extends Object implements Cookie, ServerCookie
| Constructor and Description |
|---|
CookieImpl(io.netty.handler.codec.http.cookie.Cookie nettyCookie) |
CookieImpl(ServerCookie delegate) |
CookieImpl(String name,
String value) |
| Modifier and Type | Method and Description |
|---|---|
String |
encode()
Encode the cookie to a string.
|
String |
getDomain() |
String |
getName() |
String |
getPath() |
String |
getValue() |
boolean |
isChanged()
Has the cookie been changed? Changed cookieMap will be saved out in the response and sent to the browser.
|
boolean |
isFromUserAgent()
Has this Cookie been sent from the User Agent (the browser)? or was created during the executing on the request.
|
void |
setChanged(boolean changed)
Set the cookie as being changed.
|
Cookie |
setDomain(String domain)
Sets the domain of this cookie
|
Cookie |
setHttpOnly(boolean httpOnly)
Determines if this cookie is HTTP only.
|
Cookie |
setMaxAge(long maxAge)
Sets the maximum age of this cookie in seconds.
|
Cookie |
setPath(String path)
Sets the path of this cookie.
|
Cookie |
setSecure(boolean secure)
Sets the security getStatus of this cookie
|
Cookie |
setValue(String value)
Sets the value of this cookie
|
public CookieImpl(ServerCookie delegate)
public CookieImpl(io.netty.handler.codec.http.cookie.Cookie nettyCookie)
public String getValue()
public Cookie setValue(String value)
Cookiepublic String getName()
public Cookie setDomain(String domain)
Cookiepublic String getDomain()
public Cookie setPath(String path)
Cookiepublic String getPath()
public Cookie setMaxAge(long maxAge)
Cookie0 is specified, this cookie will be
automatically removed by browser because it will expire immediately.
If Long.MIN_VALUE is specified, this cookie will be removed when the
browser is closed.
If you don't set this the cookie will be a session cookie and be removed when the browser is closed.public Cookie setSecure(boolean secure)
Cookiepublic Cookie setHttpOnly(boolean httpOnly)
CookiesetHttpOnly in interface CookiehttpOnly - True if the cookie is HTTP only, otherwise false.public String encode()
Cookiepublic boolean isChanged()
CookieisChanged in interface ServerCookiepublic void setChanged(boolean changed)
CookiesetChanged in interface ServerCookiechanged - true if changedpublic boolean isFromUserAgent()
CookieisFromUserAgent in interface ServerCookieCopyright © 2020. All rights reserved.