ServerCookie (Apache Tomcat 7.0.104 API Documentation)

org.apache.tomcat.util.http

## 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 and Description
    `ServerCookie()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `appendCookieValue(StringBuffer headerBuf, int version, String name, String value, String path, String domain, String comment, int maxAge, boolean isSecure, boolean isHttpOnly)`
    `MessageBytes` | `getComment()`
    `MessageBytes` | `getDomain()`
    `int` | `getMaxAge()`
    `MessageBytes` | `getName()`
    `MessageBytes` | `getPath()`
    `boolean` | `getSecure()`
    `MessageBytes` | `getValue()`
    `int` | `getVersion()`
    `void` | `recycle()`
    `void` | `setMaxAge(int expiry)`
    `void` | `setSecure(boolean flag)`
    `void` | `setVersion(int v)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### ServerCookie

          public ServerCookie()

  - ### Method Detail

    - #### recycle

          public void recycle()

    - #### getComment

          public MessageBytes getComment()

    - #### getDomain

          public MessageBytes getDomain()

    - #### setMaxAge

          public void setMaxAge(int expiry)

    - #### getMaxAge

          public int getMaxAge()

    - #### getPath

          public MessageBytes getPath()

    - #### setSecure

          public void setSecure(boolean flag)

    - #### getSecure

          public boolean getSecure()

    - #### getName

          public MessageBytes getName()

    - #### getValue

          public MessageBytes getValue()

    - #### getVersion

          public int getVersion()

    - #### setVersion

          public void setVersion(int v)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### appendCookieValue

          public static void appendCookieValue(StringBuffer headerBuf,
                               int version,
                               String name,
                               String value,
                               String path,
                               String domain,
                               String comment,
                               int maxAge,
                               boolean isSecure,
                               boolean isHttpOnly)

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.