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

Make localStorage+cookie the default persistence #876

Closed
benjackwhite opened this issue Nov 3, 2023 · 4 comments
Closed

Make localStorage+cookie the default persistence #876

benjackwhite opened this issue Nov 3, 2023 · 4 comments
Assignees

Comments

@benjackwhite
Copy link
Collaborator

We currently default to cookie for persistence which has the major issue that there are tight limits on how much can be stored.

More and more we rely on storage for relevant parameters such as registered properties or utm campaigns and localStorage+cookie works great for balancing the two.

To make this happen we need to:

  1. Change the default
  2. Change the startup logic to check cookie storage and migrate it to localstorage if there is no existing data in localstorage
  3. That way it should mean that we can change the default without breaking anyones implementation.
  4. We would still respect explicitly set persistence options.
@timgl
Copy link
Collaborator

timgl commented Nov 3, 2023

Related issue PostHog/posthog#17311

@robbie-c
Copy link
Contributor

robbie-c commented Nov 3, 2023

@timgl
Copy link
Collaborator

timgl commented Nov 3, 2023

Suggestion: keep the most important properties with sensible value limits in cookies so that they are still accurate cross-domain, but move everything else in localstorage. We should write up the list of properties we'll support cross domain.

@robbie-c
Copy link
Contributor

robbie-c commented Nov 3, 2023

Currently store [DISTINCT_ID, SESSION_ID, SESSION_RECORDING_IS_SAMPLED]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants