Add the persistent-sessions
element to your WildFly configuration to keep sessions persistent across redeployments and restarts:
<servlet-container name="default">
<jsp-config/>
<persistent-sessions />
<websockets/>
</servlet-container>
See https://docs.jboss.org/author/display/WFLY8/Undertow+%28web%29+subsystem+configuration for more information.