我有 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;
}
到这里为止很好,但是当我同时登录 2 个单独的网站(本地)并在其中任何一个上注销时,就会出现问题。当我在另一个网站上注销时(刷新时)。以下是我在注销时使用的代码。
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
}
我看不出来是什么原因造成的。我也是网络开发的新手。
我还想知道这是否是登录用户的正确方式。