PricingBlog

The new SessionStorage and LocalStorage formulas and actions

  • darrenbignall-1174377510184697936

    DarrenBignall

    2 years ago

    I am just having a play with the SessionStorage and setting a value, everything is working inside the editor using Firefox, and it works for site preview on Safari and Chrome, but for site preview in Firefox the value is showing as "undefined". Does session storage work differently in Firefox?
    👀1
  • erikbeus-1174616202157490256

    Erik Beuschau

    2 years ago

    It should work the same across browsers 😅 Could you add a few reproduction steps perhaps? 🤞 I'm happy to investigate
  • darrenbignall-1174683437714649088

    DarrenBignall

    2 years ago

    Thanks @Erik Beuschau I have run some tests and do get it working sometimes in Firefox, but cannot see what I am doing wrong with the specific case.

    I have a login flow that calls an api, on success it sets the session cookie and 'saves to session storage' a key / value for the user role.

    based on the user role it then either redirects, or it makes another api call to retrieve some results and save some of that data to session storage, it is this 'save to session storage' that is not working (only in Firefox).

    so within the same flow the first save to session storage works correctly across all browsers, but the second one remains undefined only in Firefox, and works in chrome and safari.

    i have tried adding the "save to session storage' in numerous places throughout the workflow and with different key names and storing different data, but it always works in chrome and not in firefox .... seems really weird, but must be something to do with my end ...
  • erikbeus-1174686127794434048

    Erik Beuschau

    2 years ago

    That does sound strange 🤔 I'm happy to have a look at your project if you send me an invite on erik@toddle.dev
    Sometimes, it's useful to use the Log to console action to debug what's happening in intermediate steps. Not sure if that's helpful in your case, but that's probably how I would start debugging it to check when/if the value you're trying to save is undefined
  • darrenbignall-1174689065543667713

    DarrenBignall

    2 years ago

    thanks, i have invited you and will try and debug using log to console as well.
    💪1