new session work
This commit is contained in:
parent
a72cec5f10
commit
5b2fd4d013
@ -27,6 +27,8 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
|
|||||||
|
|
||||||
registry.addViewController("/login.html");
|
registry.addViewController("/login.html");
|
||||||
registry.addViewController("/homepage.html");
|
registry.addViewController("/homepage.html");
|
||||||
|
registry.addViewController("/sessionExpired.html");
|
||||||
|
registry.addViewController("/invalidExpired.html");
|
||||||
registry.addViewController("/console.html");
|
registry.addViewController("/console.html");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
http://www.springframework.org/schema/beans
|
http://www.springframework.org/schema/beans
|
||||||
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">
|
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">
|
||||||
|
|
||||||
<http use-expressions="true">
|
<http create-session="always" use-expressions="true">
|
||||||
<intercept-url pattern="/anonymous*" access="isAnonymous()" />
|
<intercept-url pattern="/anonymous*" access="isAnonymous()" />
|
||||||
<intercept-url pattern="/login*" access="permitAll" />
|
<intercept-url pattern="/login*" access="permitAll" />
|
||||||
<intercept-url pattern="/**" access="isAuthenticated()" />
|
<intercept-url pattern="/**" access="isAuthenticated()" />
|
||||||
@ -15,7 +15,11 @@
|
|||||||
|
|
||||||
<logout delete-cookies="JSESSIONID" />
|
<logout delete-cookies="JSESSIONID" />
|
||||||
|
|
||||||
<remember-me key="uniqueAndSecret" token-validity-seconds="86400"/>
|
<remember-me key="uniqueAndSecret" token-validity-seconds="86400" />
|
||||||
|
|
||||||
|
<session-management>
|
||||||
|
<concurrency-control max-sessions="2" />
|
||||||
|
</session-management>
|
||||||
|
|
||||||
</http>
|
</http>
|
||||||
|
|
||||||
|
@ -12,6 +12,9 @@
|
|||||||
<listener>
|
<listener>
|
||||||
<listener-class>org.baeldung.web.SessionListenerWithMetrics</listener-class>
|
<listener-class>org.baeldung.web.SessionListenerWithMetrics</listener-class>
|
||||||
</listener>
|
</listener>
|
||||||
|
<listener>
|
||||||
|
<listener-class>org.springframework.security.ui.session.HttpSessionEventPublisher</listener-class>
|
||||||
|
</listener>
|
||||||
|
|
||||||
<!-- Spring root -->
|
<!-- Spring root -->
|
||||||
<context-param>
|
<context-param>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user