File tree Expand file tree Collapse file tree
spring-security-mvc-session/src/main Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ public void addViewControllers(final ViewControllerRegistry registry) {
2727
2828 registry .addViewController ("/login.html" );
2929 registry .addViewController ("/homepage.html" );
30+ registry .addViewController ("/sessionExpired.html" );
31+ registry .addViewController ("/invalidExpired.html" );
3032 registry .addViewController ("/console.html" );
3133 }
3234
Original file line number Diff line number Diff line change 66 http://www.springframework.org/schema/beans
77 http://www.springframework.org/schema/beans/spring-beans-3.2.xsd" >
88
9- <http use-expressions =" true" >
9+ <http create-session = " always " use-expressions =" true" >
1010 <intercept-url pattern =" /anonymous*" access =" isAnonymous()" />
1111 <intercept-url pattern =" /login*" access =" permitAll" />
1212 <intercept-url pattern =" /**" access =" isAuthenticated()" />
1313
1414 <form-login login-page =' /login.html' authentication-success-handler-ref =" myAuthenticationSuccessHandler" authentication-failure-url =" /login.html?error=true" />
1515
1616 <logout delete-cookies =" JSESSIONID" />
17-
18- <remember-me key =" uniqueAndSecret" token-validity-seconds =" 86400" />
19-
17+
18+ <remember-me key =" uniqueAndSecret" token-validity-seconds =" 86400" />
19+
20+ <session-management >
21+ <concurrency-control max-sessions =" 2" />
22+ </session-management >
23+
2024 </http >
2125
2226 <beans : bean id =" myAuthenticationSuccessHandler" class =" org.baeldung.security.MySimpleUrlAuthenticationSuccessHandler" />
Original file line number Diff line number Diff line change 1212 <listener >
1313 <listener-class >org.baeldung.web.SessionListenerWithMetrics</listener-class >
1414 </listener >
15+ <listener >
16+ <listener-class >org.springframework.security.ui.session.HttpSessionEventPublisher</listener-class >
17+ </listener >
1518
1619 <!-- Spring root -->
1720 <context-param >
You can’t perform that action at this time.
0 commit comments