Represents a browser session.

Sessions persist between HTTP requests for a single browser session. They are deleted when the browser is closed, or they time-out. Session cookies are used to maintain sessions using a secure UUID.

Sessions can be used to maintain data for a browser session, e.g. a shopping basket.

The context must have first been routed to a SessionHandler for sessions to be available.

  • Session
    • Basic
      • Identifiable
      • Object
        • Anything

no subtypes hierarchy

Initializer
Session(Session unknown)
Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
destroyshared default void destroy()

Destroy the session

getshared default T? get<T>(String key)

Get some data from the session

Parameters:
  • key

    the key of the data

idshared default String id()
isDestroyedshared default Boolean isDestroyed()
isRegeneratedshared default Boolean isRegenerated()
lastAccessedshared default Integer lastAccessed()
oldIdshared default String oldId()
putshared default Session put(String key, Object? obj)

Put some data in a session

Parameters:
  • key

    the key for the data

  • obj

    the data

regenerateIdshared default Session regenerateId()
removeshared default T? remove<T>(String key)

Remove some data from the session

Parameters:
  • key

    the key of the data

setAccessedshared default void setAccessed()

Mark the session as being accessed.

timeoutshared default Integer timeout()
Inherited Methods
Methods inherited from: Object
equals