Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables are lost, but session remains when closing the browser #369

Open
pgrill79 opened this issue Jun 9, 2024 · 1 comment
Open
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@pgrill79
Copy link

pgrill79 commented Jun 9, 2024

We set several variables on the login - when the user now closes the browser and opens the site again, he is still logged in but all the variables are "forgotten" which leads to a strange behaviour.

@aeberhart
Copy link
Contributor

In the browser, there are two kinds of storage (see https://stackoverflow.com/questions/5523140/are-there-any-benefits-to-session-storage-over-local-storage):

localStorage and sessionStorage both extend Storage. There is no difference between them except for the intended "non-persistence" of sessionStorage.

That is, the data stored in localStorage persists until explicitly deleted. Changes made are saved and available for all current and future visits to the site.

For sessionStorage, changes are only available per tab. Changes made are saved and available for the current page in that tab until it is closed. Once it is closed, the stored data is deleted.

We store browser authentication in localStore and delete it when you log out.

Variables and Notebooks are stored in the session store.

The rationale for this is that you may want to have two browser windows open that use different variables. E.g. if you're using a variable to store a query filter, you can view two versions of a chart in two windows.

So I guess the problem is, that once you re-open the browser, you're getting the on-login event to re-set the variables, right? I think we have the following options:

  1. store variables in localStore - maybe more intuitive but we loose the multi-tab feature
  2. introduce session and local variables - flexible but might be hard to understand
  3. we're working on an on-load hook which could be used here

@aeberhart aeberhart added this to the 5.2 milestone Jun 11, 2024
@aeberhart aeberhart added the documentation Improvements or additions to documentation label Jun 11, 2024
@aeberhart aeberhart modified the milestones: 5.1.30, 5.2 Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants