Skip to content

rfe: cleanup/remove disallowed cookies #206

@jnorell

Description

@jnorell

This has been questioned a lot, but it sure seems fairly doable to have the plugin actually remove cookies which should not be allowed, rather than just provide the hooks for programmers to integrate the settings.

A simple loop through all cookies set in both php and javascript, run through is_allowed_cookie() for each, and delete if not allowed ought to do it. Maybe safeguard with a hard coded exception list (so you don't delete wordpress core cookies and break admin functionality, or forget to exclude the 'gdpr' cookie itself so all cookies end up mysteriously removed).

One issue to workout is a placeholder in the cookie names like {hash}, {uid} etc. - something so is_allowed_cookie() can be just a bit smarter and match a simple regex. It should probably also handle names formatted as an array, eg. allowing 'gdpr' works to allow gdpr[allowed_cookies], gdpr[consent_types], etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions