Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 988
André Pena Avatar asked Sep 02 '10 21:09

André Pena


People also ask

What is the name of the cookie used for authentication?

A Cookie-based authentication uses the HTTP cookies to authenticate the client requests and maintain session information on the server over the stateless HTTP protocol.

How do I remove authentication from a cookie form?

You first need to Clear the Authentication Cookie and Session Cookie by passing back empty cookies in the Response to the Logout. public ActionResult LogOff() { FormsAuthentication. SignOut(); Session. Clear(); // This may not be needed -- but can't hurt Session.

What is authentication mode forms?

Form authentication is used for internet web application. The advantage of form authentication is that users do not have to be member of a domain-based network to have access to your application. So the number of web application uses the form authentication in their web application.


1 Answers

In your web.config:

<authentication mode="Forms">
  <forms name="{WhateverCookieNameYouWant}" loginUrl="LogOn.aspx" />
</authentication>
like image 178
Dustin Hodges Avatar answered Oct 06 '22 00:10

Dustin Hodges