Pashupati Khanal
Pashupati Khanal

Reputation: 743

Asp.Net MVC Authentication Cookie Conflict

Suppose I Created two projects with name ABC and XYZ , and I am using MVC's Inbuilt Identity for Security. Then Problem is, If i login in app ABC I am also Logged In In XYZ . The Authentication Cookie created by ABC app is accepted by XYZ. How to resolve this conflict.

Upvotes: 2

Views: 597

Answers (1)

jimSampica
jimSampica

Reputation: 12410

MVC5

app.UseCookieAuthentication(new CookieAuthenticationOptions
{
    CookieName = "Project1_ApplicationCookie",
    ...
}

MVC6

services.ConfigureApplicationCookie(options => {
    options.Cookie.Name = "Project1_ApplicationCookie";
    ...
});

Rename "Project1" to something relevant and change it between projects

Upvotes: 2

Related Questions