title: Relative path for Forms Authentication cookie
body: <pre><code>&lt;authentication mode="Forms"&gt;
    &lt;forms name="ASPAuth" 
           path="/Admin" 
           timeout="20" 
           requireSSL="false" 
           slidingExpiration="true" /&gt;
  &lt;/authentication&gt;
  </code></pre>
  
  <p>On my dev system I have the above in my web.config. This works fine if I am using VS web server. But when I host the same website on my IIS7 using a virtual directory it doesn't.</p>
  
  <p>VS Url looks like: <a href="http://localhost:xxxx/" rel="nofollow">http://localhost:xxxx/</a> </p>
  
  <p>IIS URL looks like: <a href="http://MachineName/MyApp/" rel="nofollow">http://MachineName/MyApp/</a>.</p>
  
  <p>When accessing the website through IIS the IsAuthenticated is always false. I figured out that it's because the cookie is being assigned to <a href="http://MachineName/Admin/" rel="nofollow">http://MachineName/Admin/</a> not <a href="http://MachineName/MyApp/Admin" rel="nofollow">http://MachineName/MyApp/Admin</a>.</p>
  
  <p>How I make it so that "Admin" is a relative path? I tried path="~/Admin" but that doesn't work.</p>
  
  <p>Thanks!</p>