The Session interface mainly defines session information, which is first parsed as follows:
1. Get sessionId
Serializable getId();
2. Get the start time
Date getStartTimestamp();
3. Get the last access time
Date getLastAccessTime();
4. Get the timeout
long getTimeout() throws InvalidSessionException;
5. Set the timeout
void setTimeout(long maxIdleTimeInMillis) throws InvalidSessionException;
6. Get the host name or host ip address
String getHost();
7. Update last access time
void touch() throws InvalidSessionException;
8. Pause the session and release all resources
void stop() throws InvalidSessionException;
9. Return the key-value collection of all attributes under the session
Collection<Object> getAttributeKeys() throws InvalidSessionException;
10. Get the value of the attribute under the session according to the key
Object getAttribute(Object key) throws InvalidSessionException;
11. Set the attribute value under the session
void setAttribute(Object key, Object value) throws InvalidSessionException;
12. Remove the attributes under the session
Object removeAttribute(Object key) throws InvalidSessionException;