Typically a web server will create a cookies and pass it to the browser using HTTP response headers. The browser will store it (in a cookies jar) and will send it back to the server in HTTP request headers.
In its simplest form a cookies has a name and a value. It also has some optional attributes such as path, domain, maxAge and comment.
Warning: Serialized implementaions of this interface will not be compatible with future releases. The current serialization support is only appropriate for short term storage. @volantis-api-include-in PublicAPI @volantis-api-include-in ProfessionalServicesAPI @volantis-api-include-in InternalAPIbeginXXX()
(to send cookies) or in endXXX()
methods (to assert returned cookies).
@author Vincent Massol
@version $Id: Cookie.java,v 1.2 2001/09/14 20:16:11 pier Exp $
A cookie has a name, a single value, and optional attributes such as a comment, path and domain qualifiers, a maximum age, and a version number. Some Web browsers have bugs in how they handle the optional attributes, so use them sparingly to improve the interoperability of your servlets.
The servlet sends cookies to the browser by using the {@link Response#addCookie} method, which addsfields to HTTP response headers to send cookies to the browser, one at a time. The browser is expected to support 20 cookies for each Web server, 300 cookies total, and may limit cookie size to 4 KB each.
The browser returns cookies to the servlet by adding fields to HTTP request headers. Cookies can be retrieved from a request by using the {@link Request#getCookies} method.Several cookies might have the same name but different path attributes.
Cookies affect the caching of the Web pages that use them. HTTP 1.0 does not cache pages that use cookies created with this class. This class does not support the cache control defined with HTTP 1.1.
This class supports both the Version 0 (by Netscape) and Version 1 (by RFC 2109) cookie specifications. By default, cookies are created using Version 0 to ensure the best interoperability. @author Carsten Ziegeler @version CVS $Revision: 1.1.1.1 $ $Date: 2001/05/09 20:49:43 $
HTTP "magic-cookie" represents a piece of state information that the HTTP agent and the target server can exchange to maintain a session.
@author B.C. Holmes @author Park, Sung-Gu @author Doug Sale @author Rod Waldhoff @author dIon Gillard @author Sean C. Sullivan @author John Evans @author Marc A. Saegesser @author Oleg Kalnichevski @author Mike Bowler @version $Revision: 1.44 $ $Date: 2004-06-05 12:49:20 -0400 (Sat, 05 Jun 2004) $A cookie has a name, a single value, and optional attributes such as a comment, path and domain qualifiers, a maximum age, and a version number. Some Web browsers have bugs in how they handle the optional attributes, so use them sparingly to improve the interoperability of your servlets. The browser is expected to support 20 cookies for each Web server, 300 cookies total, and may limit cookie size to 4 KB each.
Cookies affect the caching of the Web pages that use them. HTTP 1.0 does not cache pages that use cookies created with this class. This class does not support the cache control defined with HTTP 1.1.
This class supports both the Version 0 (by Netscape) and Version 1 (by RFC 2109) cookie specifications. By default, cookies are created using Version 0 to ensure the best interoperability. @author Various @version $Version$
Cookie
is set to 1. The version can be configured using the setVersion
method. The domain, path, security, and expiry of the cookie can also be set using their respective set methods. The toString
method allows the Cookie
to be converted back into text form. This text form converts the cookie according to the Set-Cookie header form. This is done so that a created Cookie
instance can be converted to a string which can be used as a a HTTP header.
@author Niall Gallagher
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|