Skip to content

Commit

Permalink
make Component:cookieHttpOnly deprecated
Browse files Browse the repository at this point in the history
because if it has a `true` value then CookieConsent library cannot manage the cookies from the frontend it they are set via form submission
  • Loading branch information
albertborsos committed May 15, 2019
1 parent 4e72bc2 commit a9776d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Component.php
Expand Up @@ -110,6 +110,7 @@ class Component extends \yii\base\Component implements CategoryInterface, Cookie
/**
* this value will be passed to `setcookie()` method.
* @var string
* @deprecated since `1.2.4` because if it has a `true` value then CookieConsent library cannot manage the cookies from the frontend it they are set via form submission
*/
public $cookieHttpOnly = false;

Expand Down
4 changes: 2 additions & 2 deletions src/domains/CookieSettingsDomain.php
Expand Up @@ -38,9 +38,9 @@ private function storeSettingsInCookies()
$currentValue = ArrayHelper::getValue($_COOKIE, $name);
if ($currentValue !== $newValue) {
unset($_COOKIE[$name]);
setcookie($name, $newValue, $expireAt, $component->cookiePath, $component->cookieDomain, $component->cookieSecure, $component->cookieHttpOnly);
setcookie($name, $newValue, $expireAt, $component->cookiePath, $component->cookieDomain, $component->cookieSecure);
}
}
setcookie(Component::COOKIECONSENT_STATUS, $component->getNotAllowedTypeByComplianceType(), $expireAt, $component->cookiePath, $component->cookieDomain, $component->cookieSecure, $component->cookieHttpOnly);
setcookie(Component::COOKIECONSENT_STATUS, $component->getNotAllowedTypeByComplianceType(), $expireAt, $component->cookiePath, $component->cookieDomain, $component->cookieSecure);
}
}

0 comments on commit a9776d7

Please sign in to comment.