src/IntentAnalyticsModule.php
private function saveVisitor()
    {
        Yii::$app->session->set($this->visitorCookieName, $this->visitor->getPrimaryKey());

        if (!Yii::$app->request->cookies->has($this->visitorCookieName)) {
            $this->setVisitorCookie();
            return;
        }

        $cookie = Yii::$app->request->cookies->get($this->visitorCookieName);
        if ($cookie->expire - time() <= $this->visitorCookieExpireTime) {
            $this->setVisitorCookie();
        }
    }
private function saveVisitor()
    {
        Yii::$app->session->set($this->visitorCookieName, $this->visitor->getPrimaryKey());

        if (!Yii::$app->request->cookies->has($this->visitorCookieName)) {
            $this->setVisitorCookie();
            return;
        }

        $cookie = Yii::$app->request->cookies->get($this->visitorCookieName);
        if ($cookie->expire - time() <= $this->visitorCookieExpireTime) {
            $this->setVisitorCookie();
        }
    }
private function saveVisitor ( ) { Yii :: $ app -> session -> set ( $ this -> visitorCookieName , $ this -> visitor -> getPrimaryKey ( ) ) ; if ( ! Yii :: $ app -> request -> cookies -> has ( $ this -> visitorCookieName ) ) { $ this -> setVisitorCookie ( ) ; return ; } $ cookie = Yii :: $ app -> request -> cookies -> get ( $ this -> visitorCookieName ) ; if ( $ cookie -> expire - time ( ) <= $ this -> visitorCookieExpireTime ) { $ this -> setVisitorCookie ( ) ; } }
Store visitor_id in session and if require in cookie
Store visitor_id in session and if require in cookie