2

How to set Cookie name and value with TideSDK ?

I try from this api: http://tidesdk.multipart.net/docs/user-dev/generated/#!/api/Ti.Network.HTTPClient

when I check value from set cookie.Is null. And this code:

var httpcli;
httpcli = Ti.Network.createHTTPClient();
httpcli.setCookie("test","testAA");
alert(httpcli.getCookie("test")); 

This image after run:

https://i.stack.imgur.com/anRKX.png

crepy1234
  • 95
  • 1
  • 1
  • 5

2 Answers2

0

I used local storage instead of cookies, and it worked fine.

 window.localStorage.test='this is test';

And get the value:

var item=window.localStorage.test;
alert(item);

Hope that helped you.

MadsterMaddness
  • 725
  • 3
  • 12
  • 35
wdalhaj
  • 135
  • 4
0

How about trying this:

            var httpcli;
            httpcli = Ti.Network.createHTTPCookie();
            httpcli.setName(cname);
            httpcli.setValue(cvalue);
            alert("COOKIE value: "+httpcli.getValue()); 
MadsterMaddness
  • 725
  • 3
  • 12
  • 35