original_string: public function init($siteId = '', $force = false)
      {
          $siteId = !empty($siteId) ? $siteId : $this->payload->getSiteId();
          $hasUserId = $this->cookie->getCookie(CookieNames::USER_ID);
          $hasUserId = !empty($hasUserId);
  
          //store siteId on cookies
          $this->cookie->setCookie(CookieNames::SITE_ID, $siteId);
  
          //store campaignId on cookies
          $this->storeCampaignIdIfExists();
          if (!$hasUserId || $force) {
              $newUserId = $this->replace_dashes(Uuid::v4());
              $this->cookie->setCookie(CookieNames::USER_ID, $newUserId, time() + 60 * 60 * 24 * 3650);
              return;
          }
      }
code: public function init($siteId = '', $force = false)
      {
          $siteId = !empty($siteId) ? $siteId : $this->payload->getSiteId();
          $hasUserId = $this->cookie->getCookie(CookieNames::USER_ID);
          $hasUserId = !empty($hasUserId);
  
          //store siteId on cookies
          $this->cookie->setCookie(CookieNames::SITE_ID, $siteId);
  
          //store campaignId on cookies
          $this->storeCampaignIdIfExists();
          if (!$hasUserId || $force) {
              $newUserId = $this->replace_dashes(Uuid::v4());
              $this->cookie->setCookie(CookieNames::USER_ID, $newUserId, time() + 60 * 60 * 24 * 3650);
              return;
          }
      }
code_tokens: public function init ( $ siteId = '' , $ force = false ) { $ siteId = ! empty ( $ siteId ) ? $ siteId : $ this -> payload -> getSiteId ( ) ; $ hasUserId = $ this -> cookie -> getCookie ( CookieNames :: USER_ID ) ; $ hasUserId = ! empty ( $ hasUserId ) ; //store siteId on cookies $ this -> cookie -> setCookie ( CookieNames :: SITE_ID , $ siteId ) ; //store campaignId on cookies $ this -> storeCampaignIdIfExists ( ) ; if ( ! $ hasUserId || $ force ) { $ newUserId = $ this -> replace_dashes ( Uuid :: v4 ( ) ) ; $ this -> cookie -> setCookie ( CookieNames :: USER_ID , $ newUserId , time ( ) + 60 * 60 * 24 * 3650 ) ; return ; } }
docstring: Stores a cookie that tells if a user is a new one or returned
  
  @param string $siteId
  @param bool $force
docstring_tokens: Stores a cookie that tells if a user is a new one or returned