On the problem of Shiro session failure error

Source: Internet
Author: User
Tags current time

If you encounter the following error:

Org.apache.shiro.session.ExpiredSessionException:Session with ID [5a8cb52b-e911-4ab7-91e1-11a11bb7c3a0] have expired . Last access time:16-12-14 am 11:21.  Current time:16-12-14 am 11:24.  Session timeout is set to seconds (1 minutes)

The cause of the bug: SessionManager Management to the Shiro
Specify the system SessionID, the default is: Jsessionid problem: conflict with the servlet container name, such as Jetty, TOMCAT and other default Jsessionid, when jumping out of Shiro A servlet when the Error-page container will reassign values for Jsessionid causes the logon session to be lost!
This bug can be fixed by adding the following configuration because of the Shiro itself:

 <!--Session Manager--<bean id= "SessionManager" class= " Org.apache.shiro.web.session.mgt.DefaultWebSessionManager "> <property name=" globalsessiontimeout "value=" 60 "/> <property name=" deleteinvalidsessions "value=" true "/> <property name=" sessionvalidation Schedulerenabled "value=" true "/> <property name=" Sessionvalidationscheduler "ref=" Sessionvalidationscheduler "/> <property name=" Sessiondao "ref=" Sessiondao "/> <property name=" sessionidcookieenabled "va Lue= "true"/> <property name= "Sessionidcookie" ref= "Sessionidcookie"/> </bean> <!--session COO Kie template--<bean id= "Sessionidcookie" class= "Org.apache.shiro.web.servlet.SimpleCookie" > <construct Or-arg value= "Sid"/> <property name= "HttpOnly" value= "true"/> <property name= "MaxAge" value= "- 1 "/> </bean> 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.