Top Description Constructors Methods
io.netty.handler.codec.http

public final Class ServerCookieEncoder

extends Object
Class Inheritance
Annotations
@Deprecated
Imports
io.netty.handler.codec.http.cookie.ServerCookieDecoder, java.util.Collection, .List

Deprecated

Use io.netty.handler.codec.http.cookie.ServerCookieEncoder instead

A RFC6265 compliant cookie encoder to be used server side, so some fields are sent (Version is typically ignored). As Netty's Cookie merges Expires and MaxAge into one single field, only Max-Age field is sent. Note that multiple cookies must be sent as separate "Set-Cookie" headers.
// Example
HttpResponse res = ...;
res.setHeader("Set-Cookie", ServerCookieEncoder.encode("JSESSIONID", "1234"));
See Also
ServerCookieDecoder

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static String

Returns:

a single Set-Cookie header value
encode
(String
the cookie name
name
,
String
the cookie value
value
)

Deprecated
Encodes the specified cookie name-value pair into a Set-Cookie header value.
public static String

Returns:

a single Set-Cookie header value
encode
(Cookie
the cookie
cookie
)

Deprecated
Encodes the specified cookie into a Set-Cookie header value.
public static List<String>

Returns:

the corresponding bunch of Set-Cookie headers
encode
(Cookie...
a bunch of cookies
cookies
)

Deprecated
Batch encodes cookies into Set-Cookie header values.
public static List<String>

Returns:

the corresponding bunch of Set-Cookie headers
encode
(Collection<Cookie>
a bunch of cookies
cookies
)

Deprecated
Batch encodes cookies into Set-Cookie header values.
public static List<String>

Returns:

the corresponding bunch of Set-Cookie headers
encode
(Iterable<Cookie>
a bunch of cookies
cookies
)

Deprecated
Batch encodes cookies into Set-Cookie header values.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ServerCookieEncoderback to summary
private ServerCookieEncoder()

Method Detail

encodeback to summary
public static String encode(String name, String value)

Deprecated

Encodes the specified cookie name-value pair into a Set-Cookie header value.

Parameters
name:String

the cookie name

value:String

the cookie value

Returns:String

a single Set-Cookie header value

Annotations
@Deprecated
encodeback to summary
public static String encode(Cookie cookie)

Deprecated

Encodes the specified cookie into a Set-Cookie header value.

Parameters
cookie:Cookie

the cookie

Returns:String

a single Set-Cookie header value

Annotations
@Deprecated
encodeback to summary
public static List<String> encode(Cookie... cookies)

Deprecated

Batch encodes cookies into Set-Cookie header values.

Parameters
cookies:Cookie[]

a bunch of cookies

Returns:List<String>

the corresponding bunch of Set-Cookie headers

Annotations
@Deprecated
encodeback to summary
public static List<String> encode(Collection<Cookie> cookies)

Deprecated

Batch encodes cookies into Set-Cookie header values.

Parameters
cookies:Collection<Cookie>

a bunch of cookies

Returns:List<String>

the corresponding bunch of Set-Cookie headers

Annotations
@Deprecated
encodeback to summary
public static List<String> encode(Iterable<Cookie> cookies)

Deprecated

Batch encodes cookies into Set-Cookie header values.

Parameters
cookies:Iterable<Cookie>

a bunch of cookies

Returns:List<String>

the corresponding bunch of Set-Cookie headers

Annotations
@Deprecated