ios - How to delete cookies in Nativescript -
i developing ios app using nativescript using angular. have webview in it. want delete cookies on click of button. how it?
for ios can user following code delete each cookies inside ios webview.
const cookies: = nshttpcookiestorage.sharedhttpcookiestorage.cookies; if (typeof cookies !== 'undefined') { (let = 0; < cookies.count; i++) { const cookie: nshttpcookie = <nshttpcookie>cookies.objectatindex(i); // let cookie: = cookies[i]; console.log(cookie); nshttpcookiestorage.sharedhttpcookiestorage.deletecookie(cookie); } } console.log(nshttpcookiestorage.sharedhttpcookiestorage.cookies);
after last console.log there shouldn't cookies.
kind regards
Comments
Post a Comment