Redirect User Based on User's Browser's Local Storage Value

How can I redirect a user based on their browser’s local storage values?

Example Rule:

  1. User goes to domain(dot)com/global/inventory

  2. Cloudflare checks user’s local storage key ‘location_set’

  3. If ‘location_set’ is ‘0’, do not redirect user.

  4. If ‘location_set’ is ‘1’, get user’s local storage key ‘location_slug’ value. Redirect user to domain(dot)com/{{location_slug value}}/inventory

Is this possible?

Did you ever receive an answer for this? This would be helpful if we can access the browser local storage values to determine the path of a redirect.