Class DefaultCookie
java.lang.Object
org.jboss.netty.handler.codec.http.cookie.DefaultCookie
- All Implemented Interfaces:
Comparable<Cookie>, Cookie
- Direct Known Subclasses:
DefaultCookie
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultCookie(String name, String value) Creates a new cookie with the specified name and value. -
Method Summary
Modifier and TypeMethodDescriptionintdomain()Returns the domain of thisCookie.booleaninthashCode()booleanChecks to see if thisCookiecan only be accessed via HTTP.booleanisSecure()Checks to see if thisCookieis secureintmaxAge()Returns the maximum age of thisCookiein seconds orInteger.MIN_VALUEif unspecifiedname()Returns the name of thisCookie.path()Returns the path of thisCookie.voidSets the domain of thisCookie.voidsetHttpOnly(boolean httpOnly) Determines if thisCookieis HTTP only.voidsetMaxAge(int maxAge) Sets the maximum age of thisCookiein seconds.voidSets the path of thisCookie.voidsetSecure(boolean secure) Sets the security getStatus of thisCookievoidSets the value of thisCookie.voidsetWrap(boolean wrap) Sets true if the value of thisCookieis to be wrapped with double quotes.toString()protected StringvalidateValue(String name, String value) value()Returns the value of thisCookie.booleanwrap()Returns true if the raw value of thisCookie, was wrapped with double quotes in original Set-Cookie header.
-
Field Details
-
name
-
value
-
wrap
private boolean wrap -
domain
-
path
-
maxAge
private int maxAge -
secure
private boolean secure -
httpOnly
private boolean httpOnly
-
-
Constructor Details
-
DefaultCookie
-
-
Method Details
-
name
-
value
-
setValue
-
wrap
-
setWrap
-
domain
-
setDomain
-
path
-
setPath
-
maxAge
-
setMaxAge
public void setMaxAge(int maxAge) Description copied from interface:CookieSets the maximum age of thisCookiein seconds. If an age of0is specified, thisCookiewill be automatically removed by browser because it will expire immediately. IfInteger.MIN_VALUEis specified, thisCookiewill be removed when the browser is closed. -
isSecure
-
setSecure
-
isHttpOnly
public boolean isHttpOnly()Description copied from interface:CookieChecks to see if thisCookiecan only be accessed via HTTP. If this returns true, theCookiecannot be accessed through client side script - But only if the browser supports it. For more information, please look here- Specified by:
isHttpOnlyin interfaceCookie- Returns:
- True if this
Cookieis HTTP-only or false if it isn't
-
setHttpOnly
public void setHttpOnly(boolean httpOnly) Description copied from interface:CookieDetermines if thisCookieis HTTP only. If set to true, thisCookiecannot be accessed by a client side script. However, this works only if the browser supports it. For for information, please look here.- Specified by:
setHttpOnlyin interfaceCookie- Parameters:
httpOnly- True if theCookieis HTTP only, otherwise false.
-
hashCode
-
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<Cookie>
-
toString
-
validateValue
-