I am integrating a single-page application in Dynamics 365 using Channel Integration Framework. I am using Google Chrome as browser. My application also used cookies to maintain user sessions.
However, Google has announced that from Q1 2024 here: Prepare for phasing out third-party cookies - Chrome for Developers
That they will be phasing out support for third-party cookies. My application behaves as third-party in Dynamics 365 which cannot function without cookies.
I have simulated the phasing out of third-party cookies by browsing to the following URL in Chrome:
chrome://flags/#test-third-party-cookie-phaseout
And set the Test Third Party Cookie Phaseout to Enabled but my application is not displaying.
I have tried their solution which recommends using CHIPS (Cookies Having Independent Partitioned State) by adding the "Partitioned" option in the "Set-Cookies" header but it does not work.
Here is the code I am using in ASP.NET Web API:
string setCookieHeader = Response.Headers["Set-Cookie"];
if (!string.IsNullOrEmpty(setCookieHeader))
{
setCookieHeader += ";Partitioned";
Response.Headers["Set-Cookie"] = setCookieHeader;
}
With third-party phasing out simulated, the above code should have worked.
Is this because Dynamics 365 is loading my application in an <iframe>
?
I do not have control over the creation of <iframe>
since it is in Dynamics 365. What is the solution to this problem since the "Partitioned" attribute is not working in Dynamics 365 either?
To me it appears that Microsoft also has to do something to make it work, as with third-party cookies disabled (test-third-party-cookie-phaseout flag enabled) not even CIFInitDone event is emitted.
It would be nice if someone from MS could comment on it. We are going to open a support ticket about it, I'll post any update here.