Can I change the FormsAuthentication cookie name?

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.


You can adjust it in your web.config file:

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

Yes you can specify the cookie name in web.config on forms element under authentication element.

<authentication mode="Forms">
    <forms name="RoleBasedAuthenticationCookiename" loginUrl="~/Login.aspx" defaultUrl="~/Default.aspx">
    </forms>
</authentication>