Java javax.servlet.http Cookie fields, constructors, methods, implement or subclass

Example usage for Java javax.servlet.http Cookie fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.servlet.http Cookie.

The text is from its open source code.

Subclass

javax.servlet.http.Cookie has subclasses.
Click this link to see all its subclasses.

Field

Stringvalue
booleanisHttpOnly

Constructor

Cookie(String name, String value)
Constructs a cookie with the specified name and value.

Method

Objectclone()
Overrides the standard java.lang.Object.clone method to return a copy of this Cookie.
StringgetComment()
Returns the comment describing the purpose of this cookie, or null if the cookie has no comment.
StringgetDomain()
Gets the domain name of this Cookie.
intgetMaxAge()
Gets the maximum age in seconds of this Cookie.
StringgetName()
Returns the name of the cookie.
StringgetPath()
Returns the path on the server to which the browser returns this cookie.
booleangetSecure()
Returns true if the browser is sending cookies only over a secure protocol, or false if the browser can send cookies using any protocol.
StringgetValue()
Gets the current value of this Cookie.
intgetVersion()
Returns the version of the protocol this cookie complies with.
voidsetComment(String purpose)
Specifies a comment that describes a cookie's purpose.
voidsetDomain(String domain)
Specifies the domain within which this cookie should be presented.
voidsetHttpOnly(boolean isHttpOnly)
Marks or unmarks this Cookie as HttpOnly.
voidsetMaxAge(int expiry)
Sets the maximum age in seconds for this Cookie.
voidsetPath(String uri)
Specifies a path for the cookie to which the client should return the cookie.
voidsetSecure(boolean flag)
Indicates to the browser whether the cookie should only be sent using a secure protocol, such as HTTPS or SSL.
voidsetValue(String newValue)
Assigns a new value to this Cookie.
voidsetVersion(int v)
Sets the version of the cookie protocol that this Cookie complies with.
StringtoString()
Returns a string representation of the object.