CookieBaker

play.api.mvc.CookieBaker
trait CookieBaker[T <: AnyRef]

Trait that should be extended by the Cookie helpers.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type

Members list

Value members

Abstract methods

protected def deserialize(data: Map[String, String]): T

Builds the cookie object from the given data map.

Builds the cookie object from the given data map.

Value parameters

data

the data map to build the cookie object

Attributes

Returns

a new cookie object

def emptyCookie: T

Default cookie, returned in case of error or if missing in the HTTP headers.

Default cookie, returned in case of error or if missing in the HTTP headers.

Attributes

protected def serialize(cookie: T): Map[String, String]

Converts the given cookie object into a data map.

Converts the given cookie object into a data map.

Value parameters

cookie

the cookie object to serialize into a map

Attributes

Returns

a new Map storing the key-value pairs for the given cookie

Concrete methods

Decodes the data from a Cookie.

Decodes the data from a Cookie.

Attributes

def decodeFromCookie(cookie: Option[Cookie]): T

Decodes the data from a Cookie.

Decodes the data from a Cookie.

Attributes

The cookie domain. Defaults to None.

The cookie domain. Defaults to None.

Attributes

def encodeAsCookie(data: T): Cookie

Encodes the data as a Cookie.

Encodes the data as a Cookie.

Attributes

true if the Cookie should have the httpOnly flag, disabling access from Javascript. Defaults to true.

true if the Cookie should have the httpOnly flag, disabling access from Javascript. Defaults to true.

Attributes

true if the Cookie is signed. Defaults to false.

true if the Cookie is signed. Defaults to false.

Attributes

def maxAge: Option[Int]

The cookie expiration date in seconds, None for a transient cookie

The cookie expiration date in seconds, None for a transient cookie

Attributes

true if the Cookie should have the Partitioned flag. Defaults to false.

true if the Cookie should have the Partitioned flag. Defaults to false.

Attributes

def path: String

The cookie path.

The cookie path.

Attributes

The value of the SameSite attribute of the cookie. Defaults to no SameSite.

The value of the SameSite attribute of the cookie. Defaults to no SameSite.

Attributes

true if the Cookie should have the secure flag, restricting usage to https. Defaults to false.

true if the Cookie should have the secure flag, restricting usage to https. Defaults to false.

Attributes