gCore

gCore · CookieManager

GDPR cookie consent with encrypted cookies and WordPress privacy tools.

Part of gCore · first-party Base manager (full implementation — no Pro)

What it is

CookieManager handles GDPR cookie consent, stores cookies encrypted (AES-256-CBC, encrypt-then-MAC with HMAC-SHA256), tracks expiry, and integrates with WordPress privacy (exporters and erasers). It has hard dependencies on ErrorManager and CacheManager.

Usage

$cookies = $gCore->getService('CookieManager');

// Only set an analytics cookie if the visitor consented to that category
if ($cookies->hasConsent('analytics')) {
    $cookies->setCookie('sid', $sessionId, [], 'analytics');
}
$sid = $cookies->getCookie('sid');

Public API

Full generated index: PUBLIC_API.mdCookieManager. At a glance:

Behavior & limits

Contract

Integration detail: CONTRACT.md §2.8. The universal ModuleInterface lifecycle applies here as to every manager.


Disclaimer

This software is provided "as is", without warranty of any kind, express or implied. Use of this software is entirely at your own risk. In no event shall the author or contributors be held liable for any damages arising from the use or inability to use this software.

Built by Niels Erik Torensupport the work.