Cookies

play.api.mvc.Cookies
See theCookies companion trait
object Cookies extends CookieHeaderEncoding

Helper utilities to encode Cookies.

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Cookies.type

Members list

Value members

Concrete methods

def apply(cookies: Seq[Cookie]): Cookies

Deprecated methods

override def decodeCookieHeader(cookieHeader: String): Seq[Cookie]

Decodes a Cookie header value as a proper cookie set.

Decodes a Cookie header value as a proper cookie set.

Value parameters

cookieHeader

the Cookie header value

Attributes

Returns

decoded cookies

Deprecated
true
Definition Classes
override def decodeSetCookieHeader(cookieHeader: String): Seq[Cookie]

Decodes a Set-Cookie header value as a proper cookie set.

Decodes a Set-Cookie header value as a proper cookie set.

Value parameters

cookieHeader

the Set-Cookie header value

Attributes

Returns

decoded cookies

Deprecated
true
Definition Classes
override def encodeCookieHeader(cookies: Seq[Cookie]): String

Encodes cookies as a Set-Cookie HTTP header.

Encodes cookies as a Set-Cookie HTTP header.

Value parameters

cookies

the Cookies to encode

Attributes

Returns

a valid Set-Cookie header value

Deprecated
true
Definition Classes
override def encodeSetCookieHeader(cookies: Seq[Cookie]): String

Encodes cookies as a Set-Cookie HTTP header.

Encodes cookies as a Set-Cookie HTTP header.

Value parameters

cookies

the Cookies to encode

Attributes

Returns

a valid Set-Cookie header value

Deprecated
true
Definition Classes
override def fromSetCookieHeader(header: Option[String]): Cookies

Attributes

Deprecated
true
Definition Classes
override def mergeCookieHeader(cookieHeader: String, cookies: Seq[Cookie]): String

Merges an existing Cookie header with new cookie values

Merges an existing Cookie header with new cookie values

Value parameters

cookieHeader

the existing Cookie header value

cookies

the new cookies to encode

Attributes

Returns

a valid Cookie header value

Deprecated
true
Definition Classes
override def mergeSetCookieHeader(cookieHeader: String, cookies: Seq[Cookie]): String

Merges an existing Set-Cookie header with new cookie values

Merges an existing Set-Cookie header with new cookie values

Value parameters

cookieHeader

the existing Set-Cookie header value

cookies

the new cookies to encode

Attributes

Returns

a valid Set-Cookie header value

Deprecated
true
Definition Classes

Inherited methods

Attributes

Inherited from:
CookieHeaderEncoding

Inherited fields

Play doesn't support multiple values per header, so has to compress cookies into one header. The problem is, Set-Cookie doesn't support being compressed into one header, the reason being that the separator character for header values, comma, is used in the dates in the Expires attribute of a cookie value. So we synthesise our own separator, that we use here, and before we send the cookie back to the client.

Play doesn't support multiple values per header, so has to compress cookies into one header. The problem is, Set-Cookie doesn't support being compressed into one header, the reason being that the separator character for header values, comma, is used in the dates in the Expires attribute of a cookie value. So we synthesise our own separator, that we use here, and before we send the cookie back to the client.

Attributes

Inherited from:
CookieHeaderEncoding

Attributes

Inherited from:
CookieHeaderEncoding