❔ Get Array From Cookies using C#
Hi Everyone, So I got a problem with getting the Cart array from cookies, I use this code to get the array out of cookie but it returns me this "[8" and what I got stored in the Cookies its
3 Replies
I'm assuming when you say it returns you "[8", that value is from the debugger?
Cookies are separated with commas. Cookies are basically stored as
So cookies like
will be treated as
https://github.com/dotnet/runtime/issues/58773
HttpClient
suffers a similar issue, apparently
Seems like it was fixed with .NET 7, but the issue isn't closed yet so ¯\_(ツ)_/¯
I'd maybe encode the cookie value, treat it as a string, then decode it server-sideWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.