Package play.mvc

Class Http.Session

java.lang.Object
play.mvc.Http.Session
Enclosing class:
Http

public static class Http.Session extends Object
HTTP Session.

Session data are encoded into an HTTP cookie, and can only contain simple String values.

  • Constructor Details

    • Session

      public Session()
    • Session

      public Session(Map<String,String> data)
    • Session

      public Session(play.api.mvc.Session underlying)
  • Method Details

    • data

      public Map<String,String> data()
    • get

      public Optional<String> get(String key)
      Optionally returns the session value associated with a key.
    • getOptional

      @Deprecated public Optional<String> getOptional(String key)
      Deprecated.
      Deprecated as of 2.8.0. Renamed to get(String).
      Optionally returns the session value associated with a key.
    • apply

      @Deprecated public Optional<String> apply(String key)
      Deprecated.
      Deprecated as of 2.8.0. Use get(String) instead.
      Optionally returns the session value associated with a key.
    • removing

      public Http.Session removing(String... keys)
      Returns a new session with the given keys removed.
    • adding

      public Http.Session adding(String key, String value)
      Returns a new session with the given key-value pair added.
    • adding

      public Http.Session adding(Map<String,String> values)
      Returns a new session with the values from the given map added.
    • asScala

      public play.api.mvc.Session asScala()
      Convert this session to a Scala session.
      Returns:
      the Scala session.