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
Xamarin Android CookieManager ignores cookies with samesite value set #2284
Comments
@MdNaushad I think we just need to reflect upon your code a little. A couple points:
I'm not sure what using this I just changed the code to this and it's working for me: var manager = CookieManager.Instance;
manager.SetCookie ("https://www.example.com/", "abcd=1234");
var cookie = manager.GetCookie ("https://www.example.com/");
Android.Util.Log.Debug ("MyApp", $"Cookie: {cookie}"); I'm not sure this will persist between app launches or not (you didn't mention in your steps). Closing this for now, as I think it is an Android API usage issue and not an issue with Xamarin.Android. If you have further questions about Android APIs, I think StackOverflow would be a better place for those. Hope this helps, thanks! |
Hey @jonathanpeppers : Thank you for looking into this.
It looks like you are calling the Yes I am using In the code that you have written, it's working of course because the "samesite=lax;" value is not set for the cookie that you created.
Can you please try this and let me know if it stills work? |
Android's API here doesn't like multiple semi-colons at once, take a look at the above article written by a Java/Android dev. I think you are hitting a problem with how to use Android APIs, and this is not a bug in Xamarin.Android, thanks! |
I'm not 100% sure my problem is the same, but in my case, I do the following:
But the cookieHeader does not contains the Javacript-cookie, only the first one !! |
@vd3d I think you are having an issue on the JavaScript side, looking at this post: https://stackoverflow.com/a/16842361 It seems like you need to set I know nothing about JavaScript, though! |
LOL :-) The javascript side works perfectly. The in Xamarin, I cannot read all the cookies that are added by the website, string cookieHeader = CookieManager.Instance.GetCookie(url); I only get my cookies... I don't see all the "AspNet" cookies by example! |
This is a little outside the scope of what is typically addressed in GitHub issues for Xamarin.Android because it is part of the upstream Android API behavior rather than anything specific to Xamarin, but note that when using
|
Steps to Reproduce
Expected Behavior
The cookie should be fetched
Actual Behavior
The cookie is not getting fetched
Version Information
Log File
The text was updated successfully, but these errors were encountered: