title: How to remove session cookie
body: <p>We are trying to clear the cookie details in browser on pressing 'Logout' button with the following code, but the script doesn't remove the session cookie from the browser. But by clearing the session cookies in IE8 browser using developer tool(Tools > Developer Tools >Cache > Clear Session Cookies), the cookies are cleared.</p>
  
  <pre><code>&lt;html:link page="/home.do" onclick="logout();"&gt;
      &lt;html:img  page="/images/logout.jpg"/&gt;
  &lt;/html:link&gt;
  
  function logout(){
  var cookies = document.cookie.split(";");     
  for (var i = 0; i &lt; cookies.length; i++)     {   
    var cookiename =  cookies[i].split("=");       
    var d = new Date();         
    d.setDate(d.getDate() - 4);   
    var expires = ";expires="+d;       
    var value="";       
    document.cookie = cookiename + "=" + value + expires + ";";     
    }
  }
  </code></pre>
  
  <p>How to clear the Session cookies from the browser using script?</p>