0

クラス宣言がありますが、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

最後にログインした人を取得します。理由はわかりますが (セッションではなくアプリケーションにあるため)、変更方法がわかりません。アプリケーションの代わりにセッションを使用するように変更するにはどうすればよいですか?

4

0 に答える 0