You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that if you use this mechanism to detect session timeouts, it may falsely report an error if the user logs out and then logs back in without closing the browser.
19
34
This is because the session cookie is not cleared when you invalidate the session and will be resubmitted even if the user has logged out.
20
35
You may be able to explicitly delete the JSESSIONID cookie on logging out, for example by using the following syntax in the logout handler:
Unfortunately this can't be guaranteed to work with every servlet container, so you will need to test it in your environment
30
61
@@ -45,20 +76,46 @@ Header always set Set-Cookie "JSESSIONID=;Path=/tutorial;Expires=Thu, 01 Jan 197
45
76
[[ns-concurrent-sessions]]
46
77
=== Concurrent Session Control
47
78
If you wish to place constraints on a single user's ability to log in to your application, Spring Security supports this out of the box with the following simple additions.
48
-
First you need to add the following listener to your `web.xml` file to keep Spring Security updated about session lifecycle events:
79
+
First, you need to add the following listener to your configuration to keep Spring Security updated about session lifecycle events:
49
80
50
-
[source,xml]
81
+
====
82
+
.Java
83
+
[source,java,role="primary"]
84
+
----
85
+
@Bean
86
+
public HttpSessionEventPublisher httpSessionEventPublisher() {
0 commit comments