HttpSessionListener
Learn HttpSessionListener (Servlet Listener, JSP Servlets) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
What is HttpSessionListener? • HttpSessionListener is an interface in the Java Servlet API that allows you to listen to lifecycle events of HTTP sessions. Purpose • Track creation and destruction of sessions • Monitor user activity • Perform cleanup when session expires Session Lifecycle Events • sessionCreated – triggered when a session is created. • sessionDestroyed – triggered when a session is invalidated or times out.