You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Lester <le...@gmail.com> on 2013/10/15 18:16:43 UTC

Shiro Session is coming as null for all the other pages

Hi,

I have authenticated the user and have got the shiro session in one page
successfully. But when i try to use that session in other pages of my
application i get the session as null, i guess this may be because i am
creating a new Subject in my new page. I am using this with tapestry and
LDAP.
The code for getting the existing session in my new page is below.

Subject currentUser = SecurityUtils.getSubject();
Session session=currentUser.getSession(false);

Also the shiro.ini file contents are 

sessionManager = org.apache.shiro.web.session.mgt.DefaultWebSessionManager
securityManager.sessionManager = $sessionManager
sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO 
sessionDAO.activeSessionsCacheName = shiro-activeSessionsCache 
securityManager.sessionManager.sessionDAO = $sessionDAO 
cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager 
securityManager.cacheManager = $cacheManager

And the filter in web.xml used is 

   <filter>
    <filter-name>ShiroFilter</filter-name>
    <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
	</filter>

   <filter-mapping>
    <filter-name>ShiroFilter</filter-name>
    <url-pattern>/*</url-pattern>
 </filter-mapping>
 <listener>
   
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
</listener>

Please help me as i dont know wer i have gone wrong. 

Thanks in advance, 
Lester.




--
View this message in context: http://shiro-user.582556.n2.nabble.com/Shiro-Session-is-coming-as-null-for-all-the-other-pages-tp7579252.html
Sent from the Shiro User mailing list archive at Nabble.com.