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:

https://gitlab.isb-sib.ch/calipho/nextprot-search/commit/8d9e022f3648c5df3390389a0b2c50d53501239c?view=parallel

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

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -