Class Session

java.lang.Object
ortus.boxlang.runtime.application.Session
All Implemented Interfaces:
Serializable

public class Session extends Object implements Serializable
I represent a Session. This will be stored in a BoxLang cache and will be used to store session data.
See Also:
  • Field Details

  • Constructor Details

    • Session

      public Session(Key ID, Application application)
      Constructor
      Parameters:
      ID - The ID of this session
      application - The application that this session belongs to
  • Method Details

    • buildCacheKey

      public static String buildCacheKey(Key id, Key applicationName)
      Build a cache key for a session
      Parameters:
      id - The ID of the session
      applicationName - The application name
      Returns:
      The cache key
    • updateLastVisit

      public void updateLastVisit()
      Update the last visit time
    • start

      public Session start(IBoxContext context)
      Start the session if not already started. If it is already started, just update the last visit time
      Parameters:
      context - The context that is starting the session
      Returns:
      This session
    • getID

      public Key getID()
      Get the ID of this session
      Returns:
      The ID
    • getSessionScope

      public SessionScope getSessionScope()
      Get the scope for this session
      Returns:
      The scope
    • getApplicationName

      public Key getApplicationName()
      Get the application that this session belongs to
      Returns:
      The application name
    • getCacheKey

      public String getCacheKey()
      Get the cache key for this session
    • shutdown

      public void shutdown(BaseApplicationListener listener)
      Shutdown the session
      Parameters:
      listener - The listener that is shutting down the session
    • toString

      public String toString()
      Convert to string
      Overrides:
      toString in class Object
    • asStruct

      public IStruct asStruct()
      Get the session state as a struct representation