Class SessionData


  • public class SessionData
    extends Object
    A single instance of this class is associated with a particular session of the Rule Game web app.
    • Method Detail

      • getSessionData

        public static SessionData getSessionData​(jakarta.servlet.http.HttpServletRequest request)
        Looks up the SessionData object already associated with the current session, or creates a new one. This is done atomically, synchronized on the session object.

        This can also be used in command-like app with simulated session, when this method will simply create a new dummy SessionData object.

        Parameters:
        request - The current HTTP request (or null in a command-like app with simulated session).
      • getStoredUserName

        public String getStoredUserName()
        Unlike getRemoteUser(), this method does not recheck the extended session cookie. It is safe to use if we know that getRemoteUser() has been recently called.
      • getStoredDisplayName

        public String getStoredDisplayName()
      • getPasswordMatched

        public boolean getPasswordMatched()
      • storeUserInfo

        public void storeUserInfo​(User user,
                                  boolean _passwordMatched)
        Saves the user name (received from the [validated] login form, or recovered via a persistent cookie) into the session's memory.