Andre Pena
Andre Pena

Reputation: 59336

How do I customize the Forms Authentication cookie name?

I have 2 websites running on localhost in different ports. As browsers do not differentiate port numbers when sending cookies, my forms authentication ticket from one site is being sent to the other

How do I solve this? I thought that a good solution would be to change the forms authentication ticket or one of the websites but I don't know how to do this.

Upvotes: 16

Views: 4082

Answers (1)

Dustin Hodges
Dustin Hodges

Reputation: 4195

In your web.config:

<authentication mode="Forms">
  <forms name="{WhateverCookieNameYouWant}" loginUrl="LogOn.aspx" />
</authentication>

Upvotes: 28

Related Questions