一次只能有一个用户登录

时间:2012-10-01 17:49:38

标签: c# asp.net

我有一个班级声明,public abstract class CompanyHttpApplication : HttpApplication

CompanyHttpApplication我有

public static CompanyHttpApplication Current
{
    get { return (CompanyHttpApplication)HttpContext.Current.ApplicationInstance; }
}

public CompanyProfileInfo Profile
{
    get
    {
        return profile ?? (profile = ProfileManager
            .FindProfilesByUserName(ProfileAuthenticationOption.Authenticated,
                 User.Identity.Name).Cast<CompanyProfileInfo>().ToList().First());
    }

    private set { profile = value; }
}

每当我访问用户时:

CatapultHttpApplication.Current.Profile.UserName

它会获得最后登录的人。我理解为什么(因为它在应用程序而不是会话中),但我不知道如何更改它。我该怎么做才能更改它,以便它使用会话而不是应用程序?

0 个答案:

没有答案
相关问题