public class SignedSessionStore extends Object implements SessionStore
SessionStore.InMemory
DEFAULT_TIMEOUT
Constructor and Description |
---|
SignedSessionStore(SessionToken token,
Function<String,Map<String,String>> decoder,
Function<Map<String,String>,String> encoder) |
Modifier and Type | Method and Description |
---|---|
void |
deleteSession(Context ctx,
Session session)
Delete a session from store.
|
Session |
findSession(Context ctx)
Find an existing session by ID.
|
Session |
newSession(Context ctx)
Creates a new session.
|
void |
renewSessionId(Context ctx,
Session session)
Renew Session ID.
|
void |
saveSession(Context ctx,
Session session)
Save a session.
|
void |
touchSession(Context ctx,
Session session)
Session attributes/state has changed.
|
@Nonnull public Session newSession(@Nonnull Context ctx)
SessionStore
Session.setNew(boolean)
- Optionally, set session creation time Session.setCreationTime(Instant)
- Optionally, set session last accessed time Session.setLastAccessedTime(Instant)
newSession
in interface SessionStore
ctx
- Web context.@Nullable public Session findSession(@Nonnull Context ctx)
SessionStore
Session.setLastAccessedTime(Instant)
findSession
in interface SessionStore
ctx
- Web context.null
.public void deleteSession(@Nonnull Context ctx, @Nonnull Session session)
SessionStore
Session.destroy()
.deleteSession
in interface SessionStore
ctx
- Web context.session
- Current session.public void touchSession(@Nonnull Context ctx, @Nonnull Session session)
SessionStore
touchSession
in interface SessionStore
ctx
- Web context.session
- Current session.public void saveSession(@Nonnull Context ctx, @Nonnull Session session)
SessionStore
saveSession
in interface SessionStore
ctx
- Web context.session
- Current session.public void renewSessionId(@Nonnull Context ctx, @Nonnull Session session)
SessionStore
renewSessionId
in interface SessionStore
ctx
- Web Context.session
- Session.Copyright © 2020. All rights reserved.