GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Overview
  • Use
  • Tree
  • Deprecated
  • Index
  • Search
  • Help
  • io.netty.handler.codec.http.cookie
  • ClientCookieEncoder

This view

  • Original page
  • New address

GeezerVison is showing netty.io — ClientCookieEncoder (Netty API Reference (4.1.141.Final))

Class ClientCookieEncoder

java.lang.Object
io.netty.handler.codec.http.cookie.CookieEncoder
io.netty.handler.codec.http.cookie.ClientCookieEncoder

public final class ClientCookieEncoder extends CookieEncoder
A RFC6265 compliant cookie encoder to be used client side, so only name=value pairs are sent. Note that multiple cookies are supposed to be sent at once in a single "Cookie" header.
// Example
HttpRequest req = ...;
res.setHeader("Cookie", ClientCookieEncoder.encode("JSESSIONID", "1234"));
See Also:
  • ClientCookieDecoder
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final ClientCookieEncoder
    LAX
    Lax instance that doesn't validate name and value, and (for methods that accept multiple cookies) keeps cookies in the order in which they were given.
    static final ClientCookieEncoder
    STRICT
    Strict encoder that validates that name and value chars are in the valid scope and (for methods that accept multiple cookies) sorts cookies into order of decreasing path length, as specified in RFC6265.

    Fields inherited from class CookieEncoder

    strict
    Modifier and Type
    Field
    Description
    protected final boolean
    strict
     
  • Method Summary

    Modifier and Type
    Method
    Description
    String
    encode(Cookie cookie)
    Encodes the specified cookie into a Cookie header value.
    String
    encode(Cookie... cookies)
    Encodes the specified cookies into a single Cookie header value.
    String
    encode(Iterable<? extends Cookie> cookies)
    Encodes the specified cookies into a single Cookie header value.
    String
    encode(String name, String value)
    Encodes the specified cookie into a Cookie header value.
    String
    encode(Collection<? extends Cookie> cookies)
    Encodes the specified cookies into a single Cookie header value.

    Methods inherited from class CookieEncoder

    validateCookie
    Modifier and Type
    Method
    Description
    protected void
    validateCookie(String name, String value)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • STRICT

      public static final ClientCookieEncoder STRICT
      Strict encoder that validates that name and value chars are in the valid scope and (for methods that accept multiple cookies) sorts cookies into order of decreasing path length, as specified in RFC6265.
    • LAX

      public static final ClientCookieEncoder LAX
      Lax instance that doesn't validate name and value, and (for methods that accept multiple cookies) keeps cookies in the order in which they were given.
  • Method Details

    • encode

      public String encode(String name, String value)
      Encodes the specified cookie into a Cookie header value.
      Parameters:
      name - the cookie name
      value - the cookie value
      Returns:
      a Rfc6265 style Cookie header value
    • encode

      public String encode(Cookie cookie)
      Encodes the specified cookie into a Cookie header value.
      Parameters:
      cookie - the specified cookie
      Returns:
      a Rfc6265 style Cookie header value
    • encode

      public String encode(Cookie... cookies)
      Encodes the specified cookies into a single Cookie header value.
      Parameters:
      cookies - some cookies
      Returns:
      a Rfc6265 style Cookie header value, null if no cookies are passed.
    • encode

      public String encode(Collection<? extends Cookie> cookies)
      Encodes the specified cookies into a single Cookie header value.
      Parameters:
      cookies - some cookies
      Returns:
      a Rfc6265 style Cookie header value, null if no cookies are passed.
    • encode

      public String encode(Iterable<? extends Cookie> cookies)
      Encodes the specified cookies into a single Cookie header value.
      Parameters:
      cookies - some cookies
      Returns:
      a Rfc6265 style Cookie header value, null if no cookies are passed.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.