setAttribute(String, object)
setAttribute(String, object) method is used to set an object by assigning a unique string to that object, later that object can be used anyway in the application by using the unique string.
getAttribute(String, object)
getAttribute(String) method is used to get the session which is already stored in
setAttribute() method and the return type of this method is an object.
removeAttribute(String) method is used to remove the session object which is stored in the session. To pass a unique string removeAttribute's method can be used.
getAttributesNames() method is used to return all the objects which are stored in the session.
getId() method returns the unique string identifier from a session in which servlet container is assigned.
getCreationTime() method is used when a session is initialized and returns session creation time.
isNew() method checks whether a session is new or not, If a session is new it returns true otherwise false.
invalidate() method is used for making session inactive and breaks the session with stored object.
getLastAccessedTime() method returns the session last access time.
getMaxInactiveInterval() method returns maximum inactive time of session.