SessionCookieBaker

play.api.mvc.SessionCookieBaker

Helper utilities to manage the Session cookie.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

Concrete methods

def deserialize(data: Map[String, String]): Session

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

override def domain: Option[String]

The cookie domain. Defaults to None.

The cookie domain. Defaults to None.

Attributes

Definition Classes
override def httpOnly: Boolean

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

Definition Classes
override 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

Definition Classes
override def path: String

The cookie path.

The cookie path.

Attributes

Definition Classes
override def sameSite: Option[SameSite]

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

Definition Classes
override def secure: Boolean

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

Definition Classes
def serialize(session: Session): 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

Inherited methods

def decode(data: String): Map[String, String]

Decodes from an encoded String.

Decodes from an encoded String.

Attributes

Inherited from:
CookieDataCodec
def decodeCookieToMap(cookie: Option[Cookie]): Map[String, String]

Decodes the data from a Cookie.

Decodes the data from a Cookie.

Attributes

Inherited from:
CookieBaker
def decodeFromCookie(cookie: Option[Cookie]): T

Decodes the data from a Cookie.

Decodes the data from a Cookie.

Attributes

Inherited from:
CookieBaker

Attributes

Inherited from:
CookieBaker
def encode(data: Map[String, String]): String

Encodes the data as a String.

Encodes the data as a String.

Attributes

Inherited from:
CookieDataCodec

Encodes the data as a Cookie.

Encodes the data as a Cookie.

Attributes

Inherited from:
CookieBaker

Concrete fields

lazy val emptyCookie: Session

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

override val isSigned: Boolean

true if the Cookie is signed. Defaults to false.

true if the Cookie is signed. Defaults to false.

Attributes