js/dataManager/sessionManager.js
function createSession(){

    // can also check if any ealier session can be used
    if (!currentSession){
        
        const createNewSession = _setSessionReferrer();
        const currentSessionCookie = utils.getCookie(constants.sessionCookieName);

        if (currentSessionCookie && !createNewSession){

            const currentSessionSplit = currentSessionCookie.split('__');
            currentSession = new session(currentSessionSplit[0], 
                parseInt(currentSessionSplit[1]), {});
            
            logger.debug('Found existing session', currentSessionSplit[0], 
                currentSessionSplit[1]);

        } else{

            currentSession = new session(null, null, {});
            setSessionCookie();

            logger.debug('Creating new session', currentSession.getSessionToken(), 
                currentSession.getSessionUnixTime());

        }

        // associate session referrer with the session
        if (sessionReferrer){

            currentSession.setExtra('referrer', sessionReferrer);
            
        }
        
    }

    return currentSession;

}
function createSession(){

    // can also check if any ealier session can be used
    if (!currentSession){
        
        const createNewSession = _setSessionReferrer();
        const currentSessionCookie = utils.getCookie(constants.sessionCookieName);

        if (currentSessionCookie && !createNewSession){

            const currentSessionSplit = currentSessionCookie.split('__');
            currentSession = new session(currentSessionSplit[0], 
                parseInt(currentSessionSplit[1]), {});
            
            logger.debug('Found existing session', currentSessionSplit[0], 
                currentSessionSplit[1]);

        } else{

            currentSession = new session(null, null, {});
            setSessionCookie();

            logger.debug('Creating new session', currentSession.getSessionToken(), 
                currentSession.getSessionUnixTime());

        }

        // associate session referrer with the session
        if (sessionReferrer){

            currentSession.setExtra('referrer', sessionReferrer);
            
        }
        
    }

    return currentSession;

}
function createSession ( ) { // can also check if any ealier session can be used if ( ! currentSession ) { const createNewSession = _setSessionReferrer ( ) ; const currentSessionCookie = utils . getCookie ( constants . sessionCookieName ) ; if ( currentSessionCookie && ! createNewSession ) { const currentSessionSplit = currentSessionCookie . split ( '__' ) ; currentSession = new session ( currentSessionSplit [ 0 ] , parseInt ( currentSessionSplit [ 1 ] ) , { } ) ; logger . debug ( 'Found existing session' , currentSessionSplit [ 0 ] , currentSessionSplit [ 1 ] ) ; } else { currentSession = new session ( null , null , { } ) ; setSessionCookie ( ) ; logger . debug ( 'Creating new session' , currentSession . getSessionToken ( ) , currentSession . getSessionUnixTime ( ) ) ; } // associate session referrer with the session if ( sessionReferrer ) { currentSession . setExtra ( 'referrer' , sessionReferrer ) ; } } return currentSession ; }
Manages creation of current session.
@memberof DataManager
@private
Manages creation of current session .