Package org.wildfly.security.http.util
Class SimpleHttpServerCookie
java.lang.Object
org.wildfly.security.http.util.SimpleHttpServerCookie
- All Implemented Interfaces:
HttpServerCookie
A simple implementation of
HttpServerCookie.- Author:
- Darran Lofthouse
-
Method Summary
Modifier and TypeMethodDescriptionGets the domain name of this cookie.intGets the maximum age in seconds of this Cookie.getName()Returns the name of the cookie.getPath()Returns the path on the server to which the browser returns this cookie.getValue()Returns the current value of this cookie.intReturns the version of the protocol this cookie complies with.booleanChecks whether this cookie has been marked as HttpOnly.booleanisSecure()Returnstrueif the browser is sending cookies only over a secure protocol, orfalseif the browser can send cookies using any protocol.static HttpServerCookienewInstance(String name, String value, String domain, int maxAge, String path, boolean secure, int version, boolean httpOnly)
-
Method Details
-
getName
Description copied from interface:HttpServerCookieReturns the name of the cookie.- Specified by:
getNamein interfaceHttpServerCookie- Returns:
- the name of the cookie
-
getValue
Description copied from interface:HttpServerCookieReturns the current value of this cookie.- Specified by:
getValuein interfaceHttpServerCookie- Returns:
- the current value of this cookie
-
getDomain
Description copied from interface:HttpServerCookieGets the domain name of this cookie.- Specified by:
getDomainin interfaceHttpServerCookie- Returns:
- the domain name of this cookie
-
getMaxAge
public int getMaxAge()Description copied from interface:HttpServerCookieGets the maximum age in seconds of this Cookie.- Specified by:
getMaxAgein interfaceHttpServerCookie- Returns:
- an integer specifying the maximum age of the cookie in seconds
-
getPath
Description copied from interface:HttpServerCookieReturns the path on the server to which the browser returns this cookie.- Specified by:
getPathin interfaceHttpServerCookie- Returns:
- a
Stringspecifying a path on the server
-
isSecure
public boolean isSecure()Description copied from interface:HttpServerCookieReturnstrueif the browser is sending cookies only over a secure protocol, orfalseif the browser can send cookies using any protocol.- Specified by:
isSecurein interfaceHttpServerCookie- Returns:
trueif the browser uses a secure protocol,falseotherwise
-
getVersion
public int getVersion()Description copied from interface:HttpServerCookieReturns the version of the protocol this cookie complies with.- Specified by:
getVersionin interfaceHttpServerCookie- Returns:
- the version of the protocol this cookie complies with.
-
isHttpOnly
public boolean isHttpOnly()Description copied from interface:HttpServerCookieChecks whether this cookie has been marked as HttpOnly.- Specified by:
isHttpOnlyin interfaceHttpServerCookie- Returns:
- true if this cookie has been marked as HttpOnly, false otherwise
-
newInstance
public static HttpServerCookie newInstance(String name, String value, String domain, int maxAge, String path, boolean secure, int version, boolean httpOnly)
-