Package org.springframework.security.web.session

# Class HttpSessionEventPublisher

java.lang.Object
org.springframework.security.web.session.HttpSessionEventPublisher

All Implemented Interfaces:
  `jakarta.servlet.http.HttpSessionIdListener`, `jakarta.servlet.http.HttpSessionListener`, `EventListener`

public class HttpSessionEventPublisher extends Object implements jakarta.servlet.http.HttpSessionListener, jakarta.servlet.http.HttpSessionIdListener
Declared in web.xml as

     <listener>
         <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
     </listener>

Publishes `HttpSessionApplicationEvent`s to the Spring Root WebApplicationContext. Maps jakarta.servlet.http.HttpSessionListener.sessionCreated() to `HttpSessionCreatedEvent`. Maps jakarta.servlet.http.HttpSessionListener.sessionDestroyed() to `HttpSessionDestroyedEvent`.

## Constructor Summary

Constructors
Constructor
Description
`HttpSessionEventPublisher()`

## Method Summary

Modifier and Type
Method
Description
`void`
`sessionCreated(jakarta.servlet.http.HttpSessionEvent event)`
Handles the HttpSessionEvent by publishing a `HttpSessionCreatedEvent` to the application appContext.
`void`
`sessionDestroyed(jakarta.servlet.http.HttpSessionEvent event)`
Handles the HttpSessionEvent by publishing a `HttpSessionDestroyedEvent` to the application appContext.
`void`
`sessionIdChanged(jakarta.servlet.http.HttpSessionEvent event, String oldSessionId)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### HttpSessionEventPublisher

public HttpSessionEventPublisher()

## Method Details

### sessionCreated

public void sessionCreated(jakarta.servlet.http.HttpSessionEvent event)
Handles the HttpSessionEvent by publishing a `HttpSessionCreatedEvent` to the application appContext.

Specified by:
  `sessionCreated` in interface `jakarta.servlet.http.HttpSessionListener`
Parameters:
  `event` - HttpSessionEvent passed in by the container

### sessionDestroyed

public void sessionDestroyed(jakarta.servlet.http.HttpSessionEvent event)
Handles the HttpSessionEvent by publishing a `HttpSessionDestroyedEvent` to the application appContext.

Specified by:
  `sessionDestroyed` in interface `jakarta.servlet.http.HttpSessionListener`
Parameters:
  `event` - The HttpSessionEvent pass in by the container

### sessionIdChanged

public void sessionIdChanged(jakarta.servlet.http.HttpSessionEvent event, String oldSessionId)

Specified by:
  `sessionIdChanged` in interface `jakarta.servlet.http.HttpSessionIdListener`