ClusterSession (Apache Tomcat 9.0.111 API Documentation)
Description: declaration: package: org.apache.catalina.ha, interface: ClusterSession

# Interface ClusterSession

All Superinterfaces:
  `HttpSession, Session`

All Known Implementing Classes:
  `DeltaSession`

public interface ClusterSession extends Session, HttpSession

- ## Field Summary

  ### Fields inherited from interface Session

  `SESSION_ACTIVATED_EVENT, SESSION_CHANGED_ID_EVENT, SESSION_CREATED_EVENT, SESSION_DESTROYED_EVENT, SESSION_PASSIVATED_EVENT`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `isPrimarySession()`
  returns true if this session is the primary session, if that is the case, the manager can expire it upon timeout.
  `void`
  `setPrimarySession(boolean primarySession)`
  Sets whether this is the primary session or not.

  ### Methods inherited from interface HttpSession

  `getAttribute, getAttributeNames, getCreationTime, getId, getLastAccessedTime, getMaxInactiveInterval, getServletContext, getSessionContext, getValue, getValueNames, invalidate, isNew, putValue, removeAttribute, removeValue, setAttribute, setMaxInactiveInterval`

  ### Methods inherited from interface Session

  `access, addSessionListener, endAccess, expire, getAuthType, getCreationTime, getCreationTimeInternal, getId, getIdInternal, getIdleTime, getIdleTimeInternal, getLastAccessedTime, getLastAccessedTimeInternal, getManager, getMaxInactiveInterval, getNote, getNoteNames, getPrincipal, getSession, getThisAccessedTime, getThisAccessedTimeInternal, isAttributeDistributable, isValid, recycle, removeNote, removeSessionListener, setAuthType, setCreationTime, setId, setId, setManager, setMaxInactiveInterval, setNew, setNote, setPrincipal, setValid, tellChangedSessionId`

- ## Method Details

  - ### isPrimarySession

    boolean isPrimarySession()
    returns true if this session is the primary session, if that is the case, the manager can expire it upon timeout.
    Returns:
      True if this session is primary

  - ### setPrimarySession

    void setPrimarySession(boolean primarySession)
    Sets whether this is the primary session or not.
    Parameters:
      `primarySession` - Flag value