Javascript Cookie not working on another page
<p>Ok I have a javascript cookie , and it work on current page of site (www.example.com/about.php), but on the index page of the site (www.example.com), it is not working. It says the cookie is not set. </p>

<p>I wana to display cookie value in another page. Any ideas? </p>

<p>Here is my code:-</p>

<p>in www.example.com/about.php page on click event of button:-</p>

<pre><code>var cookievalue="testingCookie";
document.cookie="stateNcity=" + cookievalue;
var a=document.cookie;
alert(a);
</code></pre>

<p>and in www.example.com:-</p>

<pre><code>&lt;div id="abcd"&gt;click&lt;/div&gt;

$("#abcd").on("click",function()
    {
         var cookie_string = document.cookie;
         if (cookie_string.length !=0)
         {
             alert(cookie_string);
         }
         else
         {
             alert('cookie is not set');
         }
    });
</code></pre>