Dominic
Dominic

Reputation: 775

Cookie Issue with FormsAuthentication

i have two websites with FormsAuthentication which are installed on the same machine. Now if i use firebug and firecookie i can see that the applications receive both cookies the own AuthenticationCookie and the Cookie from the other one. The cookies have different names. Application 1:

<authentication mode="Forms">
  <forms loginUrl="~/Account/LogOn" name=".Cookie1" />
</authentication>

Application 2:

<authentication mode="Forms">
  <forms loginUrl="~/Account/LogOn" name=".Cookie2" />
</authentication>

Is there any reason for this behavior?

Regards

Upvotes: 1

Views: 171

Answers (1)

Alexandros B
Alexandros B

Reputation: 1891

Your problem is that since both application run on localhost the Host of both cookies is most probably the same (localhost).

A possible solution would be to set the domain and name in the web.config file as per this

There is also this answer on stackoverflow

Upvotes: 2

Related Questions