concept cookie in category scala

appears as: cookie, cookies
Play for Scala: Covers Play 2

This is an excerpt from Manning's book Play for Scala: Covers Play 2.

Play implements this in the form of a cookie that’s cleared on every response, except for the response that sets it. The reason for using a cookie is scalability. If the flash scope isn’t stored on the server, each one of a client’s requests can be handled by a different server, without having to synchronize between servers. The session is kept in a cookie for exactly the same reason.

  • play.api.mvc.Request— An HTTP request: HTTP method, URL, headers, body, and cookies
  • The session is implemented as an HTTP session cookie, which means that its total size is limited to a few kilobytes. This means that it’s well-suited to small amounts of string data, such as this saved search query, but not for larger or more complex structures. We’ll address cookies in general later in this chapter.