Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am getting following cookie values on my home page.

vsettings=HiddenNotifications=%2C19%2C; (referral)|utmcmd=referral|utmcct=/; ASPSESSIONIDQCSBCCAD=LFLGDKACEGPCPFGBANHFFBMK; ASPSESSIONIDSASDCCDA=OFEHPJACGHNKICDLFBOCJNNH; ASPSESSIONIDQCSDDCBC=LGFPBDLCKHLIOLPMCAGJNFIM; ASPSESSIONIDQCTACBAC=DCIPJDLCNDBEGEIIELCGFMDP;CustomerID; ASPSESSIONIDSCTCAABD=LHPFFLFDEMIBIENBMGMLFIFP; ASPSESSIONIDSAQDDDAD=HMCDMLFDFCLJCIBHMEHPNHME; s_cc=true; __utmc=97358351; CustomerID=755B031ED8C016EC4F90D6F3127E776AE202DEF5BC6EB9F7A9BB19E49323BC3B; ASPSESSIONIDQCSDBDAC=CFBDJEAAPJJGHMDGOCCHALHC; ASPSESSIONIDSASCBDAD=FLGJHFAAJAJBICGIMOOJEFFF;Session%5FToken=C8F2A63C3BBA4E39BBF73B83C108D1C6

I want get the value of CustomerID cookie. Using jquery I wrote this:

$.cookie('CustomerID',{ path:'/'});

But I am not getting the value for cookie - it is showing me blank.

How can I get the CustomerId cookie?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
254 views
Welcome To Ask or Share your Answers For Others

1 Answer

What you did is setting a cookie and not getting a cookie.

try var customerId = $.cookie('CustomerID');

or maybe you are trying to get the cookie from the root path but it's actually lives at a lower path..

Check out where you save the cookie!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...