Create helper allowing cookie restrictions to be controlled by feature flag

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Why

When hiding a feature behind a cookie flag we need a way to remove that restriction once the feature is ready. Doing this by changing the code couples it to the release process and might result in the need for a lengthy exception request process.

If instead we use a feature flag for disabling the restriction we can toggle it independently.

What

Create a helper method for creating a cookie restriction that can be turned off with a feature flag.

There are three possible states when using a cookie restriction:

  1. Feature requires cookie to be active
  2. Feature visible to all without needing a cookie
  3. Feature completely disabled

This helper should toggle between states (1) and (2), and could create a flag named something like cookie_restriction_for_#{feature_name}. If state three is desired another feature flag could be used.

Edited Sep 28, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading