コード例 #1
0
        private void SetLoginSession(User user)
        {
            var session = new UserSession(user.Id, user.UserName);

            UserSession.SetSession(session);
            int userid = UserSession.GetSession().UserId;
            FormsAuthentication.SetAuthCookie(user.UserName, false);
        }
コード例 #2
0
 public static void SetSession(UserSession session)
 {
     HttpContext.Current.Session[SessionName] = session;
 }