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
Fix session event handling in HazelcastSessionRepository
Previously, invoking HttpServletRequest#changeSessionId on session backed by HazelcastSessionRepository generated generated invalid session destroyed and session created events. This was due to use of IMap#remove and IMap#set when handling the change session id.
This commit improves change session id handling to prevent publishing invalid events by using IMap#delete instead of IMap#remove and keeping track of originally assigned session id.
Closesgh-1077
Copy file name to clipboardExpand all lines: spring-session-hazelcast/src/integration-test/java/org/springframework/session/hazelcast/config/annotation/web/http/EnableHazelcastHttpSessionEventsTests.java
+20-1Lines changed: 20 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2014-2017 the original author or authors.
2
+
* Copyright 2014-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -52,6 +52,7 @@
52
52
* expected after each SessionEvent.
53
53
*
54
54
* @author Tommy Ludwig
55
+
* @author Vedran Pavic
55
56
*/
56
57
@RunWith(SpringRunner.class)
57
58
@ContextConfiguration
@@ -168,6 +169,24 @@ public void saveUpdatesTimeToLiveTest() throws InterruptedException {
Copy file name to clipboardExpand all lines: spring-session-hazelcast/src/main/java/org/springframework/session/hazelcast/HazelcastSessionRepository.java
+79-43Lines changed: 79 additions & 43 deletions
Original file line number
Diff line number
Diff line change
@@ -224,20 +224,30 @@ public HazelcastSession createSession() {
224
224
225
225
@Override
226
226
publicvoidsave(HazelcastSessionsession) {
227
-
if (!session.getId().equals(session.originalId)) {
0 commit comments