src/Server/js/caliban.js
/*
             * Load session reference Id if exising session
             */
Load session reference Id if exising session
Load session reference Id if exising session
function loadSessionReferenceId() {
                configDebug && console.log('[CALIBAN_DEBUG] Get session Id: ' + (sessionReferenceId || '(not yet set)'));
                if (!sessionReferenceId) {
                    sessionReferenceId = getSessionIdFromUrl(locationHrefAlias);
                    configDebug && console.log('[CALIBAN_DEBUG] Found valid session Id in URL: ' + sessionReferenceId);
                    if (!sessionReferenceId) {
                        var isNewCampaign = isCampaignStart(),
                            cookiedSessionReferenceId = getCookie(configSessionIdParam);
                        prevSessionReferenceId = isNewCampaign ? cookiedSessionReferenceId : '';
                        sessionReferenceId = !isNewCampaign ? cookiedSessionReferenceId : '';
                    }
                     }
                }
                return sessionReferenceId;
            }
function loadSessionReferenceId ( ) { configDebug && console . log ( '[CALIBAN_DEBUG] Get session Id: ' + ( sessionReferenceId || '(not yet set)' ) ) ; if ( ! sessionReferenceId ) { sessionReferenceId = getSessionIdFromUrl ( locationHrefAlias ) ; configDebug && console . log ( '[CALIBAN_DEBUG] Found valid session Id in URL: ' + sessionReferenceId ) ; if ( ! sessionReferenceId ) { var isNewCampaign = isCampaignStart ( ) , cookiedSessionReferenceId = getCookie ( configSessionIdParam ) ; prevSessionReferenceId = isNewCampaign ? cookiedSessionReferenceId : '' ; sessionReferenceId = ! isNewCampaign ? cookiedSessionReferenceId : '' ; } } return sessionReferenceId ; }
Load session reference Id if exising session
Load session reference Id if exising session
// We are using locationHrefAlias and not currentUrl on purpose to for sure get the passed URL parameters // from original URL // sessionReferenceId = getSessionIdFromUrl(locationHrefAlias) || getCookie(configSessionIdParam); // If not found in the URL and not the begining of a new campaign then look for session reference Id in cookies // We do not care about a cookied session if we deem this to be the start of a new campaign // NOTE: We were using this logic, but what if referrer is blocked and we're mid-funnel. The cookied session would be ignored. // Referrer is simply not reliable enough to use here // Following condition must be true to retrieve stored session: // 1. Session reference Id is retrieved // 2. Referrer is NOT empty (this indicates a direct entry from outside browser or explicitly blocked) // 3. Referrer domain is same as current domain // if (cookiedSessionReferenceId && configReferrerUrl && startsUrlWithTrackerUrl(configReferrerUrl)) { // // }