The javax.servlet.http.HttpSession - Interface allows:
- getsession()
- putValue (name, value) where name is the parameter name of type String and value is of type Object.
- getValue - retrieve information from a session: Object HttpSession.getValue(name)
- getValueName - returns a String array that provides a list of all parameters passed.
- removeValues(name) - will remove the value from the session object - good for memory optimization.
Session alive
HttpSession methods that help poll the information regarding a particular session.
- getId() - if the request to a sessioobject is invalid, in that case the request can get the sessionid from the servlet by using this method.
- getSessionContext() - Information on the context of all valid Session.
- isNew() return true or false: if the browser has never seen the session then this function returns true or it returns false.
- getCreationTime - time when the session was created
- getLastAccessedTime()
- getMaxInactiveInterval()
To destroy the session use the method called