Session.Definition, Session.Destroyed, Session.Mem, Session.Store
COOKIE_SESSION
Constructor and Description |
---|
SessionImpl(ParserExecutor resolver,
boolean isNew,
String sessionId,
long timeout) |
Modifier and Type | Method and Description |
---|---|
void |
aboutToSave() |
long |
accessedAt()
The last time the client sent a request associated with this session, as the number of
milliseconds since midnight January 1, 1970 GMT, and marked by the time the container
received the request.
|
Map<String,String> |
attributes() |
long |
createdAt()
The time when this session was created, measured in milliseconds since midnight January 1, 1970
GMT for server side sessions.
|
void |
destroy()
Invalidates this session then unset any objects bound to it.
|
long |
expiryAt()
The time when this session is going to expire, measured in milliseconds since midnight
January 1, 1970 GMT.
|
Mutant |
get(String name)
Get a object from this session.
|
String |
id()
A session ID for server side sessions.
|
boolean |
isDestroyed()
True if the session was
Session.destroy() . |
boolean |
isDirty() |
boolean |
isNew() |
boolean |
isSet(String name)
Test if the var name exists inside the session local attributes.
|
long |
savedAt()
Last time the session was save it as epoch millis or
-1 for client side sessions. |
Session |
set(String name,
String value)
Set a session local using a the given name.
|
String |
toString() |
void |
touch() |
Session |
unset()
Unset/remove all the session data.
|
Mutant |
unset(String name)
Remove a local value (if any) from session locals.
|
public SessionImpl(ParserExecutor resolver, boolean isNew, String sessionId, long timeout)
public String id()
Session
Session.COOKIE_SESSION
for client side sessions.
Session ID on client sessions doesn't make sense because resolution of session is done via
cookie name.
Another reason of not saving the session ID inside the cookie, is the cookie size (up to 4kb).
If the session ID is persisted then users lost space to save business data.public long createdAt()
Session
-1
for client side sessions.public long accessedAt()
Session
-1
for client side sessions.
Actions that your application takes, such as getting or setting a value associated with the session, do not affect the access time.
accessedAt
in interface Session
-1
for client side sessions.public long expiryAt()
Session
-1
for client side sessions.public Mutant get(String name)
Session
public boolean isSet(String name)
Session
public Map<String,String> attributes()
attributes
in interface Session
public Session set(String name, String value)
Session
public Mutant unset(String name)
Session
public Session unset()
Session
public void destroy()
Session
public boolean isDestroyed()
Session
Session.destroy()
.isDestroyed
in interface Session
Session.destroy()
.public boolean isNew()
public boolean isDirty()
public long savedAt()
Session
-1
for client side sessions.public void touch()
public void aboutToSave()
Copyright © 2017. All rights reserved.