title: how to set the forms authentication cookie path
body: <p>On the same IIS web site, I have two ASP.NET web applications called /foo and /bar. Both use forms authentication and I want users to be able to log in and out of both sites independently.</p>
  
  <p>With the standard configuration for forms authentication, it seems to send a cookie path of "/" for the forms auth cookie. This means that when a user logs into /bar it logs him out of /foo which is undesirable behaviour for me.</p>
  
  <p>The obvious solution seems to be this:</p>
  
  <pre><code>FormsAuthentication.RedirectFromLoginPage(username, false, Request.ApplicationPath);
  </code></pre>
  
  <p>This makes the forms auth cookie have the application path which allows the user to log into /foo and /bar independently :-) However there is a further and more nasty problem: If the user tries to log into /Foo (with a capital F), IIS directs them to the web application /foo, but they can never log in because the browser (chrome in this case) is case sensitive when deciding whether to send the cookie based on the cookie path.</p>
  
  <p>This seems to be a common problem which every ASP.NET web app developer will face but I can't see a sensible solution for it. Please tell me i've missed something obvious?</p>
  
  <p>Thanks</p>
  
  <p>Andy</p>