jakartaee / servlet

Jakarta Servlet
https://eclipse.org/ee4j/servlet
Other
253 stars 81 forks source link

Make api clearer for SessionManager.newSession(Request request, String requestedSessionId, Consumer<ManagedSession> consumer) #550

Closed janbartel closed 9 months ago

janbartel commented 9 months ago

The Consumer<ManagedSession> is only used for callers that are Requests to be able to set the ManagedSession on themselves. This isn't at all clear from this api. Moreover, as the SessionListener.onSessionCreated listeners don't have access to the Request, it cannot matter that the ManagedSession is set on the request before the listener is called.

I suggest that this method is changed to:

public ManagedSession newSession(Request request, String requestedSessionId)

and the caller of it can retain the session however it wants.

janbartel commented 9 months ago

Sorry, wrong issue tracker