I have an object that's marked as @ConversationScoped and is used between many steps of a wizard.
This works perfectly except that when my user's are login in, the SessionFixationProtectionStrategy of Spring calls the session.invalidate() method to recreate a new session with a new id. It then goes and reattach the attributes of the invalidated session to the new one.
The problem is that there's a WeldListener instance that is bound to the sessionDestroyed event and that will kill @ConversationScoped instances that are bound to the HttpSession object.
I have disabled the SessionFixationProtectionStrategy and am now using NullAuthenticatedSessionStrategy which does nothing, but I would still like to keep the Session Fixation strategy to protect my site from this.
Any suggestions on how to work around this?
Here's a strategy I'm using:
You need to copy the SessionFixationProtectionStrategy class to be able to implement this since there are no appropriate hooks already in place. Here's the onAuthenticate.
... and here's the WeldAwareSessionFixationProtectionStrategyHelper