# Class ServerCookie

java.lang.Object
org.apache.tomcat.util.http.ServerCookie

All Implemented Interfaces:
  `Serializable`

public class ServerCookie extends Object implements Serializable
Server-side cookie representation. Allows recycling and uses MessageBytes as low-level representation ( and thus the byte -> char conversion can be delayed until we know the charset ).

Tomcat.core uses this recyclable object to represent cookies, and the facade will convert it to the external representation.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ServerCookie()`
  Creates a new empty ServerCookie instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `MessageBytes`
  `getComment()`
  `MessageBytes`
  `getDomain()`
  `MessageBytes`
  `getName()`
  Returns the name of this cookie as a `MessageBytes` object.
  `MessageBytes`
  `getPath()`
  `MessageBytes`
  `getValue()`
  Returns the value of this cookie as a `MessageBytes` object.
  `int`
  `getVersion()`
  `void`
  `recycle()`
  Resets this cookie's name and value so it can be reused.
  `void`
  `setVersion(int v)`
  `String`
  `toString()`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### ServerCookie

    public ServerCookie()
    Creates a new empty ServerCookie instance.

- ## Method Details

  - ### recycle

    public void recycle()
    Resets this cookie's name and value so it can be reused.

  - ### getComment

    public MessageBytes getComment()

  - ### getDomain

    public MessageBytes getDomain()

  - ### getPath

    public MessageBytes getPath()

  - ### getName

    public MessageBytes getName()
    Returns the name of this cookie as a `MessageBytes` object.
    Returns:
      the cookie name

  - ### getValue

    public MessageBytes getValue()
    Returns the value of this cookie as a `MessageBytes` object.
    Returns:
      the cookie value

  - ### getVersion

    public int getVersion()

  - ### setVersion

    public void setVersion(int v)

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`