Uploaded image for project: 'Shiro'
  1. Shiro
  2. SHIRO-524

When I put the project packed into war, deployed to the tomcat7 cannot get the user.

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 1.2.1
    • None
    • Session Management
    • None
    • apache-tomcat-7.0.57

    Description

      When I put the project into the .war package and deplyoed to tomcat,i cannot get the user by SecurityUtils.getSubject().getPrincipal().that don't have any error.

      there are my session config:

      <!-- 会话DAO -->
      <bean id="sessionDAO"
      class="org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO">
      <property name="activeSessionsCacheName" value="shiro-activeSessionCache" />
      <property name="sessionIdGenerator" ref="sessionIDGenerator" />
      </bean>

      <!-- 会话验证调度器 -->
      <bean id="sessionValidationScheduler"
      class="com.cz073586.security.session.QuartzSessionValidationSchedulerEx">
      <property name="sessionValidationInterval" value="1800000" />
      <property name="sessionManager" ref="sessionManager" />
      </bean>

      <!-- session管理 -->
      <bean id="sessionManager"
      class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
      <!-- # 3,600,000 milliseconds = 1 hour -->
      <property name="globalSessionTimeout" value="7200000" />
      <property name="sessionIdCookieEnabled" value="true" />
      <!-- <property name="sessionIdCookie" ref="sessionIdCookie" /> -->

      <property name="sessionValidationSchedulerEnabled" value="true" />
      <property name="sessionValidationScheduler" ref="sessionValidationScheduler" />
      <property name="sessionDAO" ref="sessionDAO" />
      </bean>

      Attachments

        Activity

          People

            Unassigned Unassigned
            1154020389@qq.com liyunfang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: