Package edu.wisc.game.web

## Class SessionData

- java.lang.Object
- - edu.wisc.game.web.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 Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `getPasswordMatched()` |
    `static SessionData` | `getSessionData​(jakarta.servlet.http.HttpServletRequest request)` | Looks up the SessionData object already associated with the current session, or creates a new one.
    `String` | `getStoredDisplayName()` |
    `String` | `getStoredUserName()` | Unlike getRemoteUser(), this method does not recheck the extended session cookie.
    `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.
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### 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.