title: How to set cookie path in asp.net mvc
body: <p>I am trying to set cookie path so that they should not be accessible to other applications on a shared server if path is set to root i.e. "/"</p>
  
  <p>I am trying to set it as follows in web.config file: </p>
  
  <pre><code>&lt;forms loginUrl="~/account/logon" timeout="2880" requireSSL="true" path="my_virtual_directory_name" /&gt;
  </code></pre>
  
  <p>I know this will only work for ".ASPXAUTH" cookie. In my case path is set to this cookie and another cookie with same name is created with path set as root.</p>
  
  <p>I need to set path for all cookies and there should not be duplication of cookies, one with proper path and another with path set to root.</p>
  
  <p>Please suggest me how can I set a fixed path for all cookies in asp.net mvc 4 application.</p>
  
  <p>Thanks.</p>