Creating an app where I want to store temporary, session variables.
Let’s say a temporary user writes his name. I want this name to be available across all pages on the app, so the user sees personalised messaging across the app.
According to the Bubble documentation, it seems like a not logged in user does get created as a temporary Current User:
Thus, I save the name to the Current User. As expected, I cannot see this in the database, but I see it on the front-end under “Current User’s Name”. Great.
This name is available as I move along the pages in the app as long as I don’t open a new tab. When I open a new tab the current user seems to be a new user as “Current User’s Name” is now empty.
I think this is unexpected behaviour. Because a “normal” signed up user will keep being signed up across all tabs in the same session. But since this is not the case for the temp user, then what is written in the docs does not seem to hold true.
I’m getting the same results as you when clicking on the ‘go to new page (new tab)’ text (i.e. the name is not displaying).
If I use a javascript workflow action instead of a link element to open a new tab the name is showing as expected (so it must be being stored correctly). But with a link element it’s not.
So it seems that somehow the link element (when selecting the open in new tab option) is clearing the cookies (or in some other way clearing the current user and creating a new one) which is not what I would have expected, but it seems that’s the way it is…
However, this is not really suitable. Because if users then “force” a open in new window (e.g. by holding down “CTRL” when clicking the link) the session variables will be lost.