Object |
getAttribute(Stringname)Returns the object bound with the specified name in this session, ornullif no object is bound under the name. |
Enumeration<String> |
getAttributeNames()Returns anEnumerationofStringobjects containing the names of all the objects bound to this session. |
long |
getCreationTime()Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT. |
String |
getId()Returns a string containing the unique identifier assigned to this session. |
long |
getLastAccessedTime()Returns 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. |
int |
getMaxInactiveInterval()Returns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. |
ServletContext |
getServletContext()Returns the ServletContext to which this session belongs. |
HttpSessionContext |
getSessionContext()Deprecated.As of Version 2.1, this method is deprecated and has no replacement. It will be removed in a future version of the Java Servlet API. |
Object |
getValue(Stringname)Deprecated.As of Version 2.2, this method is replaced bygetAttribute(java.lang.String). |
String[] |
getValueNames()Deprecated.As of Version 2.2, this method is replaced bygetAttributeNames() |
void |
invalidate()Invalidates this session then unbinds any objects bound to it. |
boolean |
isNew()Returnstrueif the client does not yet know about the session or if the client chooses not to join the session. |
void |
putValue(Stringname,Objectvalue)Deprecated.As of Version 2.2, this method is replaced bysetAttribute(java.lang.String, java.lang.Object) |
void |
removeAttribute(Stringname)Removes the object bound with the specified name from this session. |
void |
removeValue(Stringname)Deprecated.As of Version 2.2, this method is replaced byremoveAttribute(java.lang.String) |
void |
setAttribute(Stringname,Objectvalue)Binds an object to this session, using the name specified. |
void |
setMaxInactiveInterval(int interval)Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. |