C# ASP.NET HeadLoginView注销单击。也从其他本地网站注销

C# ASP.NET HeadLoginView注销单击。也从其他本地网站注销,c#,asp.net,.net,login,C#,Asp.net,.net,Login,我有2-3个网络项目初学者的。在所有的网站中,我都有一个用户可以登录的登录控件。当用户使用正确的信息登录时,我设置 protected void Login1_Authenticate(object sender, AuthenticateEventArgs e) { if (CHUser.AunthencateLogin(Login1.UserName, Login1.Password))//Checks with database e.Authenticated

我有2-3个网络项目初学者的。在所有的网站中,我都有一个用户可以登录的登录控件。当用户使用正确的信息登录时,我设置

 protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{

    if (CHUser.AunthencateLogin(Login1.UserName, Login1.Password))//Checks with database
        e.Authenticated = true;
    else
        e.Authenticated = false;
 }
到目前为止还可以,但问题发生在我同时登录两个单独的本地网站,并在其中任何一个网站上注销时。当我在一个网站注销时,另一个网站在刷新时也会注销。以下是我在注销时使用的代码

protected void LoginStatus1_LoggingOut(object sender, LoginCancelEventArgs e)
    {
        Session.Clear(); //though logout works without this code. It is for other
 //sessions that are manually created by me
        }
我看不出是什么原因造成的。我对网络开发也是新手


我还想知道这是否是登录用户的正确方式。

在问题编辑中回答。已转换为社区wiki答案。看

OP写道:

谢谢@Aristos。通过在web.config.1st项目上使用以下代码解决了此问题

<authentication mode="Forms">
 <forms name=".Cookie1" ... />
</authentication>
第二个项目

<authentication mode="Forms">
     <forms name=".Cookie2" ... />
    </authentication>

在问题编辑中回答。已转换为社区wiki答案。看

OP写道:

谢谢@Aristos。通过在web.config.1st项目上使用以下代码解决了此问题

<authentication mode="Forms">
 <forms name=".Cookie1" ... />
</authentication>
第二个项目

<authentication mode="Forms">
     <forms name=".Cookie2" ... />
    </authentication>

类似的问题:哇!多谢各位@类似问题:哇!多谢各位@亚里士多德