Add support for cookie activated feature toggles

Created on 1 December 2023, over 1 year ago

A/B testing or feature rollouts would be possible with tools like Optimizely etc. if toggles could be activated with the presence of a cookie.

During investigation to see if this would be possible, it's likely that we would have to work around the internal page cache or disable it completely since it ignores cookies.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States djdevin Philadelphia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @djdevin
  • πŸ‡¬πŸ‡§United Kingdom welly

    I think this can probably be done with Cookie Condition ( https://www.drupal.org/project/cookie_condition β†’ ) in combination with Feature Toggle i some cases - for example, blocks, but would agree it'd be a useful feature to enable conditions including cookies.

    Switches ( https://www.drupal.org/project/switches β†’ ) allows this behaviour but it looks like that module is not longer being maintained.

  • πŸ‡ΊπŸ‡ΈUnited States djdevin Philadelphia

    Arbitrary conditions on toggles in general would be great, like blocks, so certain toggles could be enabled on a list of paths, certain node type, query string parameter, etc.

  • πŸ‡ΊπŸ‡ΈUnited States freelock Seattle

    The cacheability comment here reminds me of the Access Policy API - https://www.drupal.org/docs/develop/drupal-apis/access-policy-api β†’ -- the main point being if you can define a cache context as a policy, you can fully use the cache. And use it to define access.

    And... this seems like a great thing to integrate (somehow -- I don't fully understand how this works) with feature toggles. For example, I want to roll out a new chat widget on an enterprise site, and they don't want it to go live until a particular date that's in the next fiscal year. Putting it behind a feature flag and rolling it out now makes it very quick to enable when they are ready -- but if we could "enable" the feature for a particular set of users, activated by a magic link or user role, this would allow for much more complete testing in the production environment before turning it on to the world...

Production build 0.71.5 2024