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); }
private void detach_Forum_Sessions(Forum_Session entity) { this.SendPropertyChanging(); entity.Forum_User = null; }
partial void DeleteForum_Session(Forum_Session instance);
partial void UpdateForum_Session(Forum_Session instance);
partial void InsertForum_Session(Forum_Session instance);