how to retrieve codeigniter's cookie using javascript? <p>In my codeigniter's controller I have the following code:</p> <pre><code>$cookie = array( 'name' =&gt; 'my_name', 'value' =&gt; 'my value goes here' ); $this-&gt;input-&gt;set_cookie($cookie); </code></pre> <p>However, when I tried to retrieve the cookie using javascript's document.cookie, it printed strings like cookie_name, csrf_cookie_name but not my_name and 'my value goes here'. Why?</p> <p>Note: if I use the php function setcookie('my_name', 'my value goes here') then it works fine, it just I can't make it work with codeigniter's cookie helper.</p>