You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2017/04/04 11:05:41 UTC

incubator-unomi git commit: UNOMI-90 Empty sessionId is processed as a valid sessionId instead of being ignored.

Repository: incubator-unomi
Updated Branches:
  refs/heads/master 91d74da4e -> 94b6af7fa


UNOMI-90 Empty sessionId is processed as a valid sessionId instead of being ignored.

Signed-off-by: Serge Huber <sh...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/94b6af7f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/94b6af7f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/94b6af7f

Branch: refs/heads/master
Commit: 94b6af7fa60c117f6b899802c375257f04e6d460
Parents: 91d74da
Author: Serge Huber <sh...@apache.org>
Authored: Tue Apr 4 13:05:28 2017 +0200
Committer: Serge Huber <sh...@apache.org>
Committed: Tue Apr 4 13:05:38 2017 +0200

----------------------------------------------------------------------
 wab/src/main/java/org/apache/unomi/web/ContextServlet.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/94b6af7f/wab/src/main/java/org/apache/unomi/web/ContextServlet.java
----------------------------------------------------------------------
diff --git a/wab/src/main/java/org/apache/unomi/web/ContextServlet.java b/wab/src/main/java/org/apache/unomi/web/ContextServlet.java
index d3e29fe..a9ef4ef 100644
--- a/wab/src/main/java/org/apache/unomi/web/ContextServlet.java
+++ b/wab/src/main/java/org/apache/unomi/web/ContextServlet.java
@@ -158,7 +158,7 @@ public class ContextServlet extends HttpServlet {
                 }
             }
 
-            if (sessionId != null) {
+            if (sessionId != null && sessionId.trim().length() > 0) {
                 session = profileService.loadSession(sessionId, timestamp);
                 if (session != null) {
                     sessionProfile = session.getProfile();
@@ -199,8 +199,8 @@ public class ContextServlet extends HttpServlet {
                 sessionProfile = privacyService.isRequireAnonymousBrowsing(profile.getItemId()) ? privacyService.getAnonymousProfile(profile) : profile;
                 session = new Session(sessionId, sessionProfile, timestamp, scope);
 
-                if (sessionId != null) {
-                    // Only save session and send event if a session id was provided, otherise keep transient session
+                if (sessionId != null && sessionId.trim().length() > 0) {
+                    // Only save session and send event if a session id was provided, otherwise keep transient session
                     changes |= EventService.SESSION_UPDATED;
                     Event event = new Event("sessionCreated", session, profile, scope, null, session, timestamp);
                     if (sessionProfile.isAnonymousProfile()) {