title: obtain session Id from cookies using javascript
body: <p>I am trying to learn about cookies and what all they store. Since I am an active user of Google Chrome, I was thinking of accessing the session Id of a webpage from the cookie using only Javascript. I have obtained the list of all cookies stored in the browser using <code>chrome.cookies.getAll()</code>. </p>
  
  <p>However I can't understand how to access the session Id from the cookies since there is no keyword for it ?</p>
  
  <p>How can I obtain the session ID from the cookies?</p>
  
  <p>The code from obtaining the cookies is below : </p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;
  &lt;script&gt;
  chrome.browserAction.onClicked.addListener(getCookies);
  
  var cacheMap = {};
  var cookie_nameArr = [];
  var cookie_valArr = [];
  
  
      function getCookies(){
          chrome.cookies.getAll({}, function(cookies){
  
              for(var b in cookies){                      
              var cookieVal = cookies[b].value;
              var cookieName = cookies[b].domain;
                      cookie_nameArr.push(cookieName);
                      cookie_valArr.push(cookieVal);              
                  if(!cacheMap[cookieName])
                  {
                      cacheMap[cookieName] = 1;
                  }
                  else
                      cacheMap[cookieName]++;
      }//alert(cookie_nameArr.length + "," + cookie_valArr.length);
          for(var i=0;i&lt;3;i++)
      {   
          alert(cookie_nameArr[i] + ", " + cookie_valArr[i]);
  
      }
  
  });
  }
  
  &lt;/script&gt;&lt;/head&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>