Can I change the FormsAuthentication cookie name?

French Boy picture French Boy · Jul 12, 2011 · Viewed 29.2k times · Source

Can I change the FormsAuthentication cookie name?

If yes, How?

The problem which I've got is that when I have two web applications are deployed in the same domain then when anyone is logged in then the second one will be automatically logged out because they use the same Authentication's cookie name.

Answer

twoflower picture twoflower · Jul 12, 2011

You can adjust it in your web.config file:

<authentication mode="Forms">
  <forms name=".CookieName" loginUrl="LoginPage.aspx" />
</authentication>