public function getVisitorIdForThirdPartyCookie()
    {
        $found = false;

        // For 3rd party cookies, priority is on re-using the existing 3rd party cookie value
        if (!$found) {
            $useThirdPartyCookie = $this->shouldUseThirdPartyCookie();
            if ($useThirdPartyCookie) {
                $idVisitor = $this->getThirdPartyCookieVisitorId();
                if(!empty($idVisitor)) {
                    $found = true;
                }
            }
        }

        // If a third party cookie was not found, we default to the first party cookie
        if (!$found) {
            $idVisitor = Common::getRequestVar('_id', '', 'string', $this->params);
            $found = strlen($idVisitor) >= Tracker::LENGTH_HEX_ID_STRING;
        }

        if ($found) {
            return $this->getVisitorIdAsBinary($idVisitor);
        }

        return false;
    }
public function getVisitorIdForThirdPartyCookie()
    {
        $found = false;

        // For 3rd party cookies, priority is on re-using the existing 3rd party cookie value
        if (!$found) {
            $useThirdPartyCookie = $this->shouldUseThirdPartyCookie();
            if ($useThirdPartyCookie) {
                $idVisitor = $this->getThirdPartyCookieVisitorId();
                if(!empty($idVisitor)) {
                    $found = true;
                }
            }
        }

        // If a third party cookie was not found, we default to the first party cookie
        if (!$found) {
            $idVisitor = Common::getRequestVar('_id', '', 'string', $this->params);
            $found = strlen($idVisitor) >= Tracker::LENGTH_HEX_ID_STRING;
        }

        if ($found) {
            return $this->getVisitorIdAsBinary($idVisitor);
        }

        return false;
    }
public function getVisitorIdForThirdPartyCookie ( ) { $ found = false ; // For 3rd party cookies, priority is on re-using the existing 3rd party cookie value if ( ! $ found ) { $ useThirdPartyCookie = $ this -> shouldUseThirdPartyCookie ( ) ; if ( $ useThirdPartyCookie ) { $ idVisitor = $ this -> getThirdPartyCookieVisitorId ( ) ; if ( ! empty ( $ idVisitor ) ) { $ found = true ; } } } // If a third party cookie was not found, we default to the first party cookie if ( ! $ found ) { $ idVisitor = Common :: getRequestVar ( '_id' , '' , 'string' , $ this -> params ) ; $ found = strlen ( $ idVisitor ) >= Tracker :: LENGTH_HEX_ID_STRING ; } if ( $ found ) { return $ this -> getVisitorIdAsBinary ( $ idVisitor ) ; } return false ; }
When creating a third party cookie, we want to ensure that the original value set in this 3rd party cookie
sticks and is not overwritten later.
When creating a third party cookie we want to ensure that the original value set in this 3rd party cookie sticks and is not overwritten later .