Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $cityCookie = Yii::$app->request->cookies[self::COOKIE_CITY_ID];
- $cityCookie->expire = -1;
- $cityCookie->path = '/';
- $cityCookie->value = null;
- setcookie(self::COOKIE_CITY_ID, null, -1, '/');
- $cookies = Yii::$app->response->cookies;
- // add a new cookie to the response to be sent
- $cookies->add(new yiiwebCookie([
- 'name' => 'language',
- 'value' => 'zh-CN',
- ]));
- // remove a cookie
- $cookies->remove('language');
Add Comment
Please, Sign In to add comment