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

Is there a suggested method for dealing with browsers disallowing third party cookies without disabling cookies altogether? #2320

Open
jrunyen opened this issue Apr 1, 2024 · 3 comments

Comments

@jrunyen
Copy link

jrunyen commented Apr 1, 2024

We have an angular application using Application Insights that we're displaying on another site via an iframe and both Chrome and Firefox are warning that in future versions they will be dropping support for third party cookies and blocking the ai_user and ai_session cookies entirely.

Screenshot from firefox:
application insights cookie error

Chrome:
image

We have this same issue with our identity related cookies on this embedded site, but we could fix that by adding the Partitioned attributes to our cookies (google docs, mozilla docs) when they're initially written, but it doesn't seem like Application Insights has hooks for that currently

Is there any guidance on how we can handle this now or any features in the pipeline that would allow us to handle this situation without disabling the user tracking cookies entirely?

Steps to Reproduce

  1. Host two sites with different domains (A, B)
  2. Set up application insights on site B
  3. Display site B within site A via an iframe
  4. See warnings in latest versions of Firefox and Chrome with default security settings
@MSNev
Copy link
Collaborator

MSNev commented Apr 1, 2024

Interesting use-case, the key portion is point 1 host two sites with different domains.

I've tagged as an enhancement as this could be added as an optional configuration that could be used by the CookieMgr code.

Are the 2 domains related? ie. is there a common base domain?

If there is you can use the cookieDomain (or cookieCfg.domain) configuration to tell the SDK to use that as the domain when setting / creating cookies, rather than defaulting to the hosting page domain.

The existing cookie configuration options are here with the typedoc here

@vhhughes
Copy link

vhhughes commented Apr 3, 2024

We have 25 .NET web apps that each run inside IFrames in the same way. (on a separate domain from the top page frame) We're in the middle of remediating them all with other cookies in use (i.e., adding partition keys), but could not find a way for the App Insights cookies to be similarly partitioned using its SDK. It doesn't appear to currently support it, and without it, our use of the SDK is going to break for tens of thousands of customers when Chrome & Edge are updated in August. We really need to be able to adopt an updated SDK and test long before then.

@MSNev
Copy link
Collaborator

MSNev commented Apr 3, 2024

One thing you can do in the meantime is to provide your own setcookie implementation. The default version (when you don't provide one is here, so the "value" is the content of the cookie so you (should) be able to just append the Partitioned value to the string, you can even target it based on the specific cookie name if needed.

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

No branches or pull requests

3 participants