sessionscoped
SessionScoped is a scope annotation used in Java EE's Contexts and Dependency Injection (CDI) and in JavaServer Faces (JSF) to define the lifecycle of a bean. In CDI, a bean annotated with @SessionScoped has its lifecycle bound to the HTTP session. A single instance is created for a user’s session when the bean is first needed and is reused for all subsequent requests within that session. The bean persists through multiple requests and pages for the same user, until the HTTP session ends due to logout, invalidation, or timeout.
Across different user sessions, separate bean instances exist. This makes session scope suitable for maintaining user-specific
In CDI deployments, session-scoped beans are typically required to be Serializable to support possible passivation or
In JSF, there is also a legacy annotation to define session scope: javax.faces.bean.SessionScoped. While it serves