Interface HttpSession

All Superinterfaces:
jakarta.servlet.http.HttpSession
All Known Implementing Classes:
HttpRequestImpl.SessionInvalidateListener, HttpSessionImpl, ServletSessionAdapter

public interface HttpSession extends jakarta.servlet.http.HttpSession
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the object bound with the specified name in this session, or null if no object is bound under the name.
    Returns a string containing the unique identifier assigned to this session.
    void
     
    void
    setAttribute(String name, Object value)
    Binds an object to this session, using the name specified.

    Methods inherited from interface jakarta.servlet.http.HttpSession

    getAttributeNames, getCreationTime, getLastAccessedTime, getMaxInactiveInterval, getServletContext, invalidate, isNew, setMaxInactiveInterval
  • Method Details

    • removeAttribute

      void removeAttribute(String name)
      Specified by:
      removeAttribute in interface jakarta.servlet.http.HttpSession
    • getAttribute

      Object getAttribute(String name)
      Returns the object bound with the specified name in this session, or null if no object is bound under the name.
      Specified by:
      getAttribute in interface jakarta.servlet.http.HttpSession
      Parameters:
      name - a string specifying the name of the object
      Returns:
      the object with the specified name
    • setAttribute

      void setAttribute(String name, Object value)
      Binds an object to this session, using the name specified. If an object of the same name is already bound to the session, the object is replaced.
      Specified by:
      setAttribute in interface jakarta.servlet.http.HttpSession
      Parameters:
      name - the name to which the object is bound; cannot be null
      value - the object to be bound
    • getId

      String getId()
      Returns a string containing the unique identifier assigned to this session. The identifier is assigned by the ejb container and is implementation dependent.
      Specified by:
      getId in interface jakarta.servlet.http.HttpSession
      Returns:
      a string specifying the identifier assigned to this session