Пример #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;
 }