Exemple #1
0
        public static void AuthenticateUser(ForumRespository db, int UserID)
        {
            string SessionID = Guid.NewGuid().ToString();

            HttpCookie SessionCookie = new HttpCookie("MvcForum", SessionID);
            SessionCookie.HttpOnly = true;
            SessionCookie.Expires = DateTime.Now.AddYears(50);
            HttpContext.Current.Response.Cookies.Add(SessionCookie);
            var SessionStore = new Forum_Session() { UserID = UserID, SessionGUID = SessionID };
            db.AddSessionToDB(SessionStore);
            db.Save();
        }
 public void AddSessionToDB(Forum_Session ToAdd)
 {
     db.Forum_Sessions.InsertOnSubmit(ToAdd);
 }
Exemple #3
0
		private void detach_Forum_Sessions(Forum_Session entity)
		{
			this.SendPropertyChanging();
			entity.Forum_User = null;
		}
Exemple #4
0
 partial void DeleteForum_Session(Forum_Session instance);
Exemple #5
0
 partial void UpdateForum_Session(Forum_Session instance);
Exemple #6
0
 partial void InsertForum_Session(Forum_Session instance);