Top Description Fields Methods
io.netty.handler.codec.http.cookie

public Interface Cookie

extends Comparable<Cookie>
Known Direct Subinterfaces
io.netty.handler.codec.http.Cookie
Known Direct Implementers
io.netty.handler.codec.http.cookie.DefaultCookie

An interface defining an HTTP cookie.

Field Summary

Modifier and TypeField and Description
public static final long
UNDEFINED_MAX_AGE

Constant for undefined MaxAge attribute value.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The domain of this Cookie
domain
()

Returns the domain of this Cookie.

public boolean

Returns:

True if this Cookie is HTTP-only or false if it isn't
isHttpOnly
()

Checks to see if this Cookie can only be accessed via HTTP.

public boolean

Returns:

True if this Cookie is secure, otherwise false
isSecure
()

Checks to see if this Cookie is secure

public long

Returns:

The maximum age of this Cookie
maxAge
()

Returns the maximum age of this Cookie in seconds or Cookie#UNDEFINED_MAX_AGE if unspecified

public String

Returns:

The name of this Cookie
name
()

Returns the name of this Cookie.

public String

Returns:

The Cookie's path
path
()

Returns the path of this Cookie.

public void
setDomain(String
The domain to use
domain
)

Sets the domain of this Cookie.

public void
setHttpOnly(boolean
True if the Cookie is HTTP only, otherwise false.
httpOnly
)

Determines if this Cookie is HTTP only.

public void
setMaxAge(long
The maximum age of this Cookie in seconds
maxAge
)

Sets the maximum age of this Cookie in seconds.

public void
setPath(String
The path to use for this Cookie
path
)

Sets the path of this Cookie.

public void
setSecure(boolean
True if this Cookie is to be secure, otherwise false
secure
)

Sets the security getStatus of this Cookie

public void
setValue(String
The value to set
value
)

Sets the value of this Cookie.

public void
setWrap(boolean
true if wrap
wrap
)

Sets true if the value of this Cookie is to be wrapped with double quotes.

public String

Returns:

The value of this Cookie
value
()

Returns the value of this Cookie.

public boolean

Returns:

If the value of this Cookie is to be wrapped
wrap
()

Returns true if the raw value of this Cookie, was wrapped with double quotes in original Set-Cookie header.

Inherited from java.lang.Comparable:
compareTo

Field Detail

UNDEFINED_MAX_AGEback to summary
public static final long UNDEFINED_MAX_AGE

Constant for undefined MaxAge attribute value.

Method Detail

domainback to summary
public String domain()

Returns the domain of this Cookie.

Returns:String

The domain of this Cookie

isHttpOnlyback to summary
public boolean isHttpOnly()

Checks to see if this Cookie can only be accessed via HTTP. If this returns true, the Cookie cannot be accessed through client side script - But only if the browser supports it. For more information, please look here

Returns:boolean

True if this Cookie is HTTP-only or false if it isn't

isSecureback to summary
public boolean isSecure()

Checks to see if this Cookie is secure

Returns:boolean

True if this Cookie is secure, otherwise false

maxAgeback to summary
public long maxAge()

Returns the maximum age of this Cookie in seconds or Cookie#UNDEFINED_MAX_AGE if unspecified

Returns:long

The maximum age of this Cookie

nameback to summary
public String name()

Returns the name of this Cookie.

Returns:String

The name of this Cookie

pathback to summary
public String path()

Returns the path of this Cookie.

Returns:String

The Cookie's path

setDomainback to summary
public void setDomain(String domain)

Sets the domain of this Cookie.

Parameters
domain:String

The domain to use

setHttpOnlyback to summary
public void setHttpOnly(boolean httpOnly)

Determines if this Cookie is HTTP only. If set to true, this Cookie cannot be accessed by a client side script. However, this works only if the browser supports it. For information, please look here.

Parameters
httpOnly:boolean

True if the Cookie is HTTP only, otherwise false.

setMaxAgeback to summary
public void setMaxAge(long maxAge)

Sets the maximum age of this Cookie in seconds. If an age of 0 is specified, this Cookie will be automatically removed by browser because it will expire immediately. If Cookie#UNDEFINED_MAX_AGE is specified, this Cookie will be removed when the browser is closed.

Parameters
maxAge:long

The maximum age of this Cookie in seconds

setPathback to summary
public void setPath(String path)

Sets the path of this Cookie.

Parameters
path:String

The path to use for this Cookie

setSecureback to summary
public void setSecure(boolean secure)

Sets the security getStatus of this Cookie

Parameters
secure:boolean

True if this Cookie is to be secure, otherwise false

setValueback to summary
public void setValue(String value)

Sets the value of this Cookie.

Parameters
value:String

The value to set

setWrapback to summary
public void setWrap(boolean wrap)

Sets true if the value of this Cookie is to be wrapped with double quotes.

Parameters
wrap:boolean

true if wrap

valueback to summary
public String value()

Returns the value of this Cookie.

Returns:String

The value of this Cookie

wrapback to summary
public boolean wrap()

Returns true if the raw value of this Cookie, was wrapped with double quotes in original Set-Cookie header.

Returns:boolean

If the value of this Cookie is to be wrapped