Package play.mvc

Class Scope.Session

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

@NullMarked @CheckReturnValue public static class Scope.Session extends Object
Session scope
  • Field Details

  • Constructor Details

    • Session

      public Session()
    • Session

      protected Session(String id)
  • Method Details

    • getId

      public String getId()
    • all

      public Map<String,String> all()
    • getAuthenticityToken

      public String getAuthenticityToken()
    • put

      public void put(String key, @Nullable String value)
    • put

      public void put(String key, @Nullable Object value)
    • get

      public @Nullable String get(String key)
    • remove

      @CanIgnoreReturnValue public boolean remove(String key)
    • remove

      public void remove(String... keys)
    • clear

      public void clear()
    • isEmpty

      public boolean isEmpty()
      Returns true if the session is empty, e.g. does not contain anything else than the timestamp
      Returns:
      true if the session is empty, otherwise false
    • contains

      public boolean contains(String key)
    • getUserAgent

      public @Nullable String getUserAgent()
    • setUserAgent

      public void setUserAgent(String userAgent)
    • toString

      public String toString()
      Overrides:
      toString in class Object