<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic how to use cookie? in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/how-to-use-cookie/m-p/998297#M29063</link>
    <description>&lt;P&gt;when tomcat send back a cookie as flowing:&lt;/P&gt;

&lt;P&gt;Cookie cookie = new Cookie(cookieName,token);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cookie.setDomain(domain);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cookie.setPath("/");&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cookie.setMaxAge(maxAge);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;response.addCookie(cookie);&lt;/P&gt;

&lt;P&gt;I can't get cookie through:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var myCookie = document.cookie.replace(/(?:(?:^|.*;\s*)gobaby\s*\=\s*([^;]*).*$)|^.*$/, "$1");&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;var xxxs =jqxhr.getAllResponseHeaders();&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;How to get &amp;nbsp;cookie from tomcat in xdk? and how to send cookie to tomcat in xdk?&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;peng&lt;/P&gt;</description>
    <pubDate>Thu, 01 Oct 2015 04:13:47 GMT</pubDate>
    <dc:creator>xxx_x_</dc:creator>
    <dc:date>2015-10-01T04:13:47Z</dc:date>
    <item>
      <title>how to use cookie?</title>
      <link>https://community.intel.com/t5/Software-Archive/how-to-use-cookie/m-p/998297#M29063</link>
      <description>&lt;P&gt;when tomcat send back a cookie as flowing:&lt;/P&gt;

&lt;P&gt;Cookie cookie = new Cookie(cookieName,token);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cookie.setDomain(domain);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cookie.setPath("/");&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cookie.setMaxAge(maxAge);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;response.addCookie(cookie);&lt;/P&gt;

&lt;P&gt;I can't get cookie through:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var myCookie = document.cookie.replace(/(?:(?:^|.*;\s*)gobaby\s*\=\s*([^;]*).*$)|^.*$/, "$1");&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;var xxxs =jqxhr.getAllResponseHeaders();&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;How to get &amp;nbsp;cookie from tomcat in xdk? and how to send cookie to tomcat in xdk?&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;peng&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2015 04:13:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/how-to-use-cookie/m-p/998297#M29063</guid>
      <dc:creator>xxx_x_</dc:creator>
      <dc:date>2015-10-01T04:13:47Z</dc:date>
    </item>
    <item>
      <title>I don't know about other</title>
      <link>https://community.intel.com/t5/Software-Archive/how-to-use-cookie/m-p/998298#M29064</link>
      <description>&lt;P&gt;I don't know about other platforms but I did have to jump through some hoops with Android Crosswalk because it uses its own cookie manager that is different from the one used by the browser. I ended up using the CookieMaster plugin.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2015 16:27:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/how-to-use-cookie/m-p/998298#M29064</guid>
      <dc:creator>Gary_H_2</dc:creator>
      <dc:date>2015-10-06T16:27:46Z</dc:date>
    </item>
    <item>
      <title>I use this way to retrieve:</title>
      <link>https://community.intel.com/t5/Software-Archive/how-to-use-cookie/m-p/998299#M29065</link>
      <description>&lt;P&gt;I use this way to retrieve:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt; try {
        if(typeof(window.localStorage) !== 'undefined') {
            yourField = window.localStorage.getItem("yourCookieName");
        } else {
            alert('error');
            }
    }
    catch(err){
        alert('error");
    }
}   &lt;/PRE&gt;

&lt;P&gt;And to save:&lt;/P&gt;

&lt;PRE class="brush:jscript;"&gt;try {
        if(typeof(window.localStorage) != 'undefined') {
            window.localStorage.setItem("yourCookieName", "value");
            //alert(1);
            }
        else
            {
            alert('error');
            }
    }&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;It works OK on Android Cordova.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2015 16:50:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/how-to-use-cookie/m-p/998299#M29065</guid>
      <dc:creator>Hamilton_Tenório_da_</dc:creator>
      <dc:date>2015-10-06T16:50:16Z</dc:date>
    </item>
  </channel>
</rss>

