HttpSession Methods
HttpSession Methods
1118893
HttpSession Methods
getAttribute Returns the object bound with the specified name in this session, or null if no object is bound under the name. Some other methods to work with Session attributes are, removeAttribute(String name) and setAttribute This method binds an object to this session, using the name specified. removeAttribute This method removes the object bound with the specified name from this session. getAttributename This method returns the object bound with the specified name in this session, or null if no object is bound under the name getId Returns a string containing the unique identifier assigned to this session. public boolean isNew This method returns true if the client does not yet know about the session or if the client chooses not to join the session. getCreationTime Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT. 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. setMaxInactiveInterval Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. We can get session timeout value from getMaxInactiveInterval() method. void invalidate() Invalidates this session then unbinds any objects bound to it.