private function cookie($name, $value = null, $expire = 0, $domain = '', $path = '/', $secure = false)
    {
        if($value === false) {
            \Yii::$app->response->cookies->remove($name);
        } elseif($value === null) {
            return \Yii::$app->request->cookies->getValue($name);
        }

        /*$options['name'] = $name;
        $options['value'] = $value;
        $options['expire'] = $expire; //$expire?:time()+86400*365
        $options['domain'] = $domain;
        $options['path'] = $path;
        $options['secure'] = $secure;
        $cookie = new \yii\web\Cookie($options);
        \Yii::$app->response->cookies->add($cookie);*/
    }
private function cookie($name, $value = null, $expire = 0, $domain = '', $path = '/', $secure = false)
    {
        if($value === false) {
            \Yii::$app->response->cookies->remove($name);
        } elseif($value === null) {
            return \Yii::$app->request->cookies->getValue($name);
        }

        /*$options['name'] = $name;
        $options['value'] = $value;
        $options['expire'] = $expire; //$expire?:time()+86400*365
        $options['domain'] = $domain;
        $options['path'] = $path;
        $options['secure'] = $secure;
        $cookie = new \yii\web\Cookie($options);
        \Yii::$app->response->cookies->add($cookie);*/
    }
private function cookie ( $ name , $ value = null , $ expire = 0 , $ domain = '' , $ path = '/' , $ secure = false ) { if ( $ value === false ) { \ Yii :: $ app -> response -> cookies -> remove ( $ name ) ; } elseif ( $ value === null ) { return \ Yii :: $ app -> request -> cookies -> getValue ( $ name ) ; } /*$options['name'] = $name;
        $options['value'] = $value;
        $options['expire'] = $expire; //$expire?:time()+86400*365
        $options['domain'] = $domain;
        $options['path'] = $path;
        $options['secure'] = $secure;
        $cookie = new \yii\web\Cookie($options);
        \Yii::$app->response->cookies->add($cookie);*/ }
Remove or return cookie value
@todo add cookie...
@param string $name the name of the cookie
@param string $value the cookie value, if false remove cookie, if null return value
@param number $expire the cookie expire date
@return string cookie value
Remove or return cookie value