The creation of a WebSession instance does not automatically start
a session thus causing the session id to be sent to the client (typically via
a cookie). A session starts implicitly when session attributes are added.
A session may also be created explicitly via start().
| Modifier and Type | Method and Description |
|---|---|
| public Mono | Returns: completion notification (success or error)Generate a new id for the session and update the underlying session
storage to reflect the new id. After a successful call |
| public default < the attribute type T> T | Returns: the attribute valuethe attribute name name)Return the session attribute value if present. |
| public default < the attribute type T> T | Returns: the attribute valuethe attribute name name, T a default value to return instead defaultValue)Return the session attribute value, or a default, fallback value. |
| public Map | |
| public Instant | |
| public String | |
| public Instant | getLastAccessTime()
Return the last time of session access as a result of user activity such as an HTTP request. |
| public Duration | |
| public default < the attribute type T> T | Returns: the attribute valuethe attribute name name)Return the session attribute value or if not present raise an
|
| public Mono | Returns: completion notification (success or error)Invalidate the current session and clear session storage. |
| public boolean | |
| public boolean | |
| public Mono | Returns: Mono to indicate completion with success or errorSave the session through the
|
| public void | setMaxIdleTime(Duration maxIdleTime)
Configure the max amount of time that may elapse after the
|
| public void |
| changeSessionId | back to summary |
|---|---|
| public Mono Generate a new id for the session and update the underlying session
storage to reflect the new id. After a successful call | |
| getAttribute | back to summary |
|---|---|
| public default <T> T getAttribute(String name) Return the session attribute value if present.
| |
| getAttributeOrDefault | back to summary |
|---|---|
| public default <T> T getAttributeOrDefault(String name, T defaultValue) Return the session attribute value, or a default, fallback value.
| |
| getAttributes | back to summary |
|---|---|
| public Map Return a map that holds session attributes. | |
| getCreationTime | back to summary |
|---|---|
| public Instant getCreationTime() Return the time when the session was created. | |
| getId | back to summary |
|---|---|
| public String getId() Return a unique session identifier. | |
| getLastAccessTime | back to summary |
|---|---|
| public Instant getLastAccessTime() Return the last time of session access as a result of user activity such
as an HTTP request. Together with | |
| getMaxIdleTime | back to summary |
|---|---|
| public Duration getMaxIdleTime() Return the maximum time after the | |
| getRequiredAttribute | back to summary |
|---|---|
| public default <T> T getRequiredAttribute(String name) Return the session attribute value or if not present raise an
| |
| invalidate | back to summary |
|---|---|
| public Mono Invalidate the current session and clear session storage. | |
| isExpired | back to summary |
|---|---|
| public boolean isExpired() Return Typically expiration checks should be automatically made when a session
is accessed, a new | |
| isStarted | back to summary |
|---|---|
| public boolean isStarted() Whether a session with the client has been started explicitly via
| |
| save | back to summary |
|---|---|
| public Mono Save the session through the
Note that this method is not intended for direct use by applications. Instead it is automatically invoked just before the response is committed. | |
| setMaxIdleTime | back to summary |
|---|---|
| public void setMaxIdleTime(Duration maxIdleTime) Configure the max amount of time that may elapse after the
| |
| start | back to summary |
|---|---|
| public void start() Force the creation of a session causing the session id to be sent when
| |