diff --git a/README.md b/README.md index 8b29a28..1d1793e 100644 --- a/README.md +++ b/README.md @@ -187,9 +187,6 @@ public function setCookie(string $scope, string $name, string $value = "", int $ public function getCookie(string $scope, string $name, string $path = "", string $domain = "", bool $secure = false, bool $httponly = false); ``` -## Demo -A live example is available here: [https://gdpr-cookie-example.jyxon.com/](https://gdpr-cookie-example.jyxon.com/). - ## Feedback We like to get some feedback on this package. You can do so by creating an issue on GitHub. diff --git a/example/assets/css b/example/assets/css new file mode 120000 index 0000000..4cfd3cd --- /dev/null +++ b/example/assets/css @@ -0,0 +1 @@ +../../src/Frontend/css \ No newline at end of file diff --git a/example/assets/js b/example/assets/js new file mode 120000 index 0000000..8249468 --- /dev/null +++ b/example/assets/js @@ -0,0 +1 @@ +../../src/Frontend/js \ No newline at end of file diff --git a/example/index.php b/example/index.php new file mode 100644 index 0000000..2e248af --- /dev/null +++ b/example/index.php @@ -0,0 +1,88 @@ +setCookie($_GET['set_cookie'], $_GET['set_cookie'] . '_cookie', 'Cookie set!', time() + 3600, '/'); +} + +?> + + + + + + GDPR cookie compliance example + + + + +

Configuration:

+
+
+ +

Cookies set:

+
+
+ +

Analytical cookie

+
getCookie('analytical', 'analytical_cookie') ?>
+ +

Functional cookie

+
getCookie('functional', 'functional_cookie') ?>
+
+ Set analytical cookie server side + Set functional cookie server side +

+ + + + + + +

Please note: Don't forget to refresh the page after setting cookies or expecting result.

+ + diff --git a/src/Cookie/Manager.php b/src/Cookie/Manager.php index 622dfe8..0537cc9 100644 --- a/src/Cookie/Manager.php +++ b/src/Cookie/Manager.php @@ -51,9 +51,6 @@ public function canSet(string $scope): bool * @param boolean $httponly * * @return bool - * - * @SuppressWarnings(PHPMD.Superglobals) - * @SuppressWarnings(PHPMD.BooleanArgumentFlag) */ public function setCookie( string $scope, @@ -87,9 +84,6 @@ public function setCookie( * @param boolean $httponly * * @return mixed - * - * @SuppressWarnings(PHPMD.Superglobals) - * @SuppressWarnings(PHPMD.BooleanArgumentFlag) */ public function getCookie( string $scope, diff --git a/src/Cookie/Settings.php b/src/Cookie/Settings.php index 5ce3632..1465732 100644 --- a/src/Cookie/Settings.php +++ b/src/Cookie/Settings.php @@ -47,8 +47,6 @@ public function getAllowedCookies(): array * Sets the local variable of $allowedCookies with the contents of the "gdpr_cookie" contents. * * @return void - * - * @SuppressWarnings(PHPMD.Superglobals) */ private function setAllowedCookies() {