The first block uses the DefaultWebSessionManager, the second uses ServletContainerSessionManager. This helps explain the difference you are seeing.
That said, it sounds like there is a problem with Wildfly and the DefaultWebSessionManager. Any chance you have a dump of an example request/response (with http or curl) that shows this issue? (I've never really used Wildfly, so this is just a guess) On Sun, Nov 12, 2017 at 10:52 PM, Mike Guo <[email protected]> wrote: > Hi, All. > > is there anyone can help me about the session issue when I used shiro in > Wildfly? > > I configured shiro use shiro session(not http session in web container), > it work prefect when I deployed it into tomcat. but after I move my > project to wildly. I found the login function work ok. after I input > password and username, it login success and show me the page after login, > but when I try to click the other link, it will be jump to login page > again. seem to the session didn’t keep it. > > the original shiro configuration like this: > > @Bean > public DefaultWebSecurityManager securityManager() { > > > DefaultWebSessionManager sessionManager = new DefaultWebSessionManager(); > sessionManager.setGlobalSessionTimeout(60*60*1000); > > DefaultWebSecurityManager securityManager = new > DefaultWebSecurityManager(); > securityManager.setRealm(myRealm()); > securityManager.setSessionManager(sessionManager); > > > return securityManager; > > > } > > it always have this issue. > > after I change it to : > > @Bean > public DefaultWebSecurityManager securityManager() { > > > > DefaultWebSecurityManager securityManager = new > DefaultWebSecurityManager(); > securityManager.setRealm(myRealm()); > return securityManager; > > } > > > it work again. > > > sound like the shiro session have some issues. > > > anyone can help me a little tips? > > thanks > > > Mike > > >
