HttpSessionEvent Class

HttpSessionEvent class encapsulates session events. It extends EventObject and it is generated when a change occurs to the session.

MethodDescription
Object getAttribute(String attr)It returns the value associated with the name passed in attr. Returns
null if attr is not found.
Enumeration getAttributeNames( )It returns an enumeration of the attribute names associated with the
session.
long getCreationTime( )It returns the time (in milliseconds since midnight, January 1, 1970,
GMT) when this session was created.
String getId( )It returns the session ID.
long getLastAccessedTime( )It returns the time (in milliseconds since midnight, January 1, 1970,
GMT) when the client last made a request for this session.
void invalidate( )Invalidates this session and removes it from the context.
boolean isNew( )It returns true if the server created the session and it has not yet
been accessed by the client.
void removeAttribute(String attr)It returns the attribute specified by attr from the session.
void setAttribute(String attr, Object val)Associates the value passed in val with the attribute name passed
in attr.