Classes

The four classes for the java.servlet.http package are Cookie, HttpServlet, HttpSessionBindingEvent, and HttpUtils.

Cookie Class

public class Cookie
  extends java.lang.Object
  implements java.lang.Cloneable

The Cookie class represents a cookie used for session management in HTTP protocols. Cookies are name/value pairs that are created by the server and stored in the client. The Cookie class has 17 methods, described in the following sections.

Cookie() Method
public Cookie(java.lang.String name,
  java.lang.String value)

The Cookie() constructor initializes a Cookie object with the passed-in name/value pair. Names cannot contain whitespace, commas, or semicolons and should only contain ASCII alphanumeric characters. Cookie() returns ...

Get Pure Java Server Pages™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.