dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.39k stars 10k forks source link

Consent cookies in Blazor Web assembly throwing errors #38723

Closed Lingala-Joshna closed 2 years ago

Lingala-Joshna commented 2 years ago

Describe the bug

When we add consent cookies in Blazor web assembly application in .net6, throws console errors

To Reproduce

  1. Download the sample
  2. Unzip the downloaded file
  3. Run the sample
  4. Open console in the browser, the error can be found

BlazorWebAssembly.zip

Further technical details

pranavkm commented 2 years ago

Could you share a repro as a GitHub repo instead of a zip file? Thanks!

ghost commented 2 years ago

Hi @Lingala-Joshna. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

Lingala-Joshna commented 2 years ago

Hi Pranav,

Please find my GitHub repo

https://github.com/Lingala-Joshna/BlazorWasmConsentCookies

Regards, Joshna

ghost commented 2 years ago

Thanks for contacting us. We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. Because it's not immediately obvious that this is a bug in our framework, we would like to keep this around to collect more feedback, which can later help us determine the impact of it. We will re-evaluate this issue, during our next planning meeting(s). If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

pranavkm commented 2 years ago

Thanks for sharing the repro app. Blazor WebAssembly is running in the browser and as such cannot ASP.NET Core features such as the HttpContext / IHttpConextAccessor. Consider directly setting a cookie rather than using the consent feature.

Also note that ASP.NET Core 2.2 has been out of support for some time now. Using the 2.2 packages in your application is not recommended.

ghost commented 2 years ago

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.