marvelapp / react-ab-test

A/B testing React components and debug tools. Isomorphic with a simple, universal interface. Well documented and lightweight. Tested in popular browsers and Node.js. Includes helpers for Mixpanel and Segment.com.
MIT License
240 stars 47 forks source link

Option to use cookies instead of localstorage #21

Open osdiab opened 3 years ago

osdiab commented 3 years ago

Table of Contents

Expected Behavior

if local storage is a no-op for the given browser or is not present, try using a cookie or some other storage mechanism instead; can be placed behind a flag if that's not desirable.

Current Behavior

Current behavior forces local storage as the storage medium

Possible Solution

Would be great if we can use a cookie as a backup if localstorage doesn't work

Steps to Reproduce (for bugs)

not relevant

Context

Localstorage is a no-op in iOS private browsing, which we've found to be unfortunately common on our service; but cookies definitely work in that scenario.

Your Environment

gregegan commented 3 years ago

+1. Did you get this working @osdiab ?

osdiab commented 3 years ago

i didn't try but i can give it a go when my hours free up :)