javascript - Angular JS - IpCookies not working properly on localhost -
i'm using ivpusic/angular-cookie package @ moment local app. can set simple cookie one:
ipcookie('force-premium', true, { expires: 1, path: '/' });
but, whenever put in domain name different null, won't work. example, wouldn't create cookie me
ipcookie('force-premium', true, { expires: 1, path: '/', domain: 'localhost' });
but somehow works
ipcookie('force-premium', true, { expires: 1, path: '/', domain: '' });
what problem code? need set domain name because want create domain-wide cookies have several subdomains app.
hope helps:
if ($window.location.hostname === "localhost") { ipcookie('nxprofile', profile); ipcookie('nxtoken', token); } else { ipcookie('nxprofile', profile, { domain: '.nextprot.org' }); ipcookie('nxtoken', token, { domain: '.nextprot.org' }); }
Comments
Post a Comment