COOKIE_NAME_USER_PREFIX
COOKIE_NAME_USER_PREFIX ='real_cookie_banner'
Handle consents of "me".
$me :\DevOwl\RealCookieBanner\MyConsent
Singleton instance.
persist(array|string $consent,boolean $markAsDoNotTrack,string $buttonClicked,integer $viewPortWidth,integer $viewPortHeight,string $referer,integer $blocker,integer|string $blockerThumbnail = null,integer $forwarded,string $forwardedUuid = null,boolean $forwardedBlocker = false,string $tcfString = null,string $customBypass = null): array
Persist an user consent to the database.
array|string | $consent | A set of accepted cookie groups + cookies or a predefined set like |
boolean | $markAsDoNotTrack | |
string | $buttonClicked | |
integer | $viewPortWidth | |
integer | $viewPortHeight | |
string | $referer | |
integer | $blocker | If the consent came from a content blocker, mark this in our database |
integer|string | $blockerThumbnail | Can be the ID of the blocker thumbnail itself, or in format of |
integer | $forwarded | The reference to the consent ID of the source website (only for forwarded consents) |
string | $forwardedUuid | The UUID reference of the source website |
boolean | $forwardedBlocker | Determine if forwarded consent came through a content blocker |
string | $tcfString | TCF compatibility; encoded TCF string (not the vendor string; |
string | $customBypass | Allows to set a custom bypass which causes the banner to be hidden (e.g. Geolocation) |
The current used user
setCookie(array<mixed,string> $uuids = null,string $revision = null,array $consent = null)
Set or update the existing cookie to the latest revision. It also respect the fact, that cross-site cookies needs to be set with `SameSite=None` attribute.
array<mixed,string> | $uuids | |
string | $revision | |
array | $consent |
getCurrentUser(boolean $force = false): false|array
Get's the current user from the cookie. The result will hold the unique user id and the accepted revision hash. This function is also ported to JS via `getUserDecision.tsx`.
boolean | $force |
'uuid', previous_uuids
, 'created', 'cookie_revision', 'consent_revision', 'decision', 'decision_in_cookie', 'decision_hash'
parseCookieValue(string $value): array
Parse a consent from a given cookie value. The result will hold the unique user id and the accepted revision hash.
string | $value |
'uuid', previous_uuids
, 'created', 'cookie_revision', 'consent_revision', 'decision', 'decision_in_cookie', 'decision_hash'