code: function setUserData(userData) {
  
     let u = getUserData();
     if (u.coreSessionToken && userData.coreSessionToken) {
        // only store the newer one 
        let coreSessionToken = null;
        if (u.coreSessionToken.timestamp < userData.coreSessionToken.timestamp) {
           coreSessionToken = userData.coreSessionToken;
        }
        else {
           coreSessionToken = u.coreSessionToken;
        }
        userData.coreSessionToken = coreSessionToken;
     }
     
     localStorage.setItem(LOCAL_STORAGE_ID, JSON.stringify(userData));
  }
docs: /*
  Save local storage