Topic
1 reply Latest Post - ‏2012-06-20T07:25:40Z by AntonAleksandrov
SystemAdmin
SystemAdmin
570 Posts
ACCEPTED ANSWER

Pinned topic Issue with setting cookies

‏2012-06-19T22:48:27Z |
Hi,

var ltpa='testing of ltpa token value';
var ltpa2='testing of ltpa2 token value';

jq.cookie('LtpaToken',ltpa, {path : '/', domain : '.mycompany.com'});
jq.cookie('LtpaToken2',ltpa2, {path : '/', domain : '.mycompany.com'});

ltpa = jq.cookie('LtpaToken');
ltpa2 = jq.cookie('LtpaToken2');

console.log('ltpa:'+ltpa);
console.log('ltpa2:'+ltpa2);

From the above statements, I am trying to set the cookies after that read the same cookie and display it on the console.
But "null" displayed on the console for both the cookie values.

is there any issue on the above code? OR any idea how to set the cookie values?

Thanks
  • AntonAleksandrov
    AntonAleksandrov
    22 Posts
    ACCEPTED ANSWER

    Re: Issue with setting cookies

    ‏2012-06-20T07:25:40Z  in response to SystemAdmin
    First of all, this looks like a jQuery issue.
    Normally, you can access cookies with document.cookie object
    Keep in mind that some environments (like Android) will not allow you to modify cookies manually (document.cookie object will always be empty)