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

Address how cookies are handled on Portal and Ingest Board login #620

Open
maxsibilla opened this issue Jan 7, 2025 · 4 comments
Open
Assignees

Comments

@maxsibilla
Copy link
Contributor

maxsibilla commented Jan 7, 2025

Image

https://developers.google.com/privacy-sandbox/cookies/prepare/overview

@maxsibilla maxsibilla added this to CODCC Jan 7, 2025
@maxsibilla maxsibilla converted this from a draft issue Jan 7, 2025
@libpitt libpitt self-assigned this Jan 8, 2025
@libpitt libpitt moved this from Ready to In Progress in CODCC Jan 10, 2025
@libpitt
Copy link
Contributor

libpitt commented Jan 10, 2025

“You need to prepare your site for users who choose to browse without third-party cookies.” Looks like this is just for 3rd party cookies. The primary usage of cookies for us provides a seamless login experience; When a user logs in on the data ingest board, ingest-api is actually setting a cookie in the user’s browser.

response.set_cookie('info',
                    base64_json_str,
                    max_age=86400,
                    domain=current_app.config['COOKIE_DOMAIN'],
                    samesite='Lax',
                    secure=True)

We set the cookie based on domain, so a user logged in on the portal doesn’t need to log in again for the data ingest board.

@libpitt libpitt moved this from In Progress to Review/QA in CODCC Jan 14, 2025
@libpitt
Copy link
Contributor

libpitt commented Jan 14, 2025

Problems can arise when cookies are set for components that exist on different domains than the embedding document, such as images, or other documents embedded via <iframe>s. These cross-site cookies are commonly referred to as third-party cookies—but the behavior and potential issues are the same whether you own all the involved sites or not

https://developer.mozilla.org/en-US/blog/goodbye-third-party-cookies/

@libpitt
Copy link
Contributor

libpitt commented Jan 14, 2025

https://developer.mozilla.org/en-US/docs/Web/API/Storage_Access_API

The Storage Access API is intended to solve this problem; embedded cross-site content can request unrestricted access to third-party cookies and unpartitioned state on a frame-by-frame basis via the Document.requestStorageAccess() method. It can also check whether it already has access via the Document.hasStorageAccess() method

Since Document.requestStorageAccess() only applies at the moment to iframes, this does not apply to us.

@libpitt
Copy link
Contributor

libpitt commented Jan 15, 2025

Image

Image

Conclusion:
It seems this has to do with cross-site cookies in the context of iframes.

https://developers.google.com/privacy-sandbox/cookies/storage-access-api

@libpitt libpitt moved this from Review/QA to Backlog in CODCC Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

2 participants