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

Feature request: ability to store user IDs in cookie and localStorage simultaneously #11274

Open
macinjosh32 opened this issue Mar 29, 2024 · 2 comments

Comments

@macinjosh32
Copy link
Contributor

macinjosh32 commented Mar 29, 2024

Type of issue

Feature request

Description

Currently, when configuring a user ID sub-module, the publisher must choose between a storage method of cookie or html5 (localStorage). Both of these methods individually have advantages and limitations. cookie size, for example, is limited to 4K but can be persisted in the root domain, whereas html5 size is virtually unlimited (10MB) but storage is restricted is the current sub-domain. Developers working for publishers are not necessarily aware of these tradeoffs, and even if they are, it's not necessarily obvious which option will yield more optimal ID persistence.

To address this issue, I'd to introduce a third storage method that saves IDs to both cookie and localStorage. ID retrieval will re-synchronize the cookie value to localStorage if present in only the cookie (or vice-versa if present only in localStorage) before returning the value. We can name this storage method both, though we are open to alternatives. The net result -- assuming the ID module uses a domainOverride like domainOverrideToRootDomain -- is that lightweight IDs become global to the root domain, and the heaviest IDs are still stored but restricted to the current subdomain.

There is already some precedent for this technique among modules that manage their own storage. For example, LiveIntent uses this in LiveConnect's caching module.

Steps to reproduce

Test page

Expected results

Actual results

Platform details

Other information

@jdcauley
Copy link

Hello,

The Identity committee discussed this in the last week.

In general we are onboard for supporting this capability.

However, this is not something that will be targeted for work internally via the Prebid.js committee

If your or someone else would like to contribute this capability we would like to review a proposed implementation to ensure we have no additional concerns, and would welcome a contribution.

Thank you,

Jordan

@carlosfelix
Copy link
Contributor

I've started the implementation of this feature.

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

No branches or pull requests

3 participants