Passing HTTPOnly cookie from app to a webpage using UIWebView

KratiChauhan.7758KratiChauhan.7758 INMember
edited August 2017 in Xamarin.iOS

Hello

We have a requirement to send data in cookie from our app to an external web view.

The cookie should be secure and http only.

The below code is able to set the secure cookie, but not httpOnly cookie.
Can anyways please help and let me know how to set a secure HTTPOnly cookie from xamarin ios ?

Code :
var myCookie = new NSHttpCookie(CreateCookie());
NSHttpCookieStorage.SharedStorage.SetCookie(myCookie);

private System.Net.Cookie CreateCookie()
{
System.Net.Cookie cookie = new System.Net.Cookie();
cookie.Domain = DomainName";
cookie.Name = "CookieName";
cookie.Value = "Value";
cookie.Secure = true;
cookie.HttpOnly = true;
return cookie;
}

Sign In or Register to comment.