Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230106

Setting Cookies in InAppBrowser URL

$
0
0

Am trying to set a cookie for inappbrowser url after its opened in IONIC application using tough-cookie.But it’s not working.Can you please help me out. Below is my code:

var tough = require('tough-cookie');
var cookiejar = new tough.CookieJar();
cookiejar.setCookie("cookie-accepted=2", 
'http://currentdomain.example.com/path', function(err) {console.log("err"+err);});

No error but cookie not set

Using Cookie-Master

cordova.cookieMaster.setCookieValue('https://www.url.fr', 'cookie-agreed', 
'2',
 function() {
    console.log('A cookie has been set');
 },
function(error) {
    console.log('Error setting cookie: '+error);
});

Getting error as cookieMaster of undefined.Tried cordova.plugins.cookieMaster also.Also tried window.plugins.cookieMaster.


Viewing all articles
Browse latest Browse all 230106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>