private static void LogIn() { RequestParameters = WebUtil.RetrievePostParameters(); string email = RequestParameters["email"]; string password = RequestParameters["password"]; string hashedPassword = PasswordHeader.Hash(RequestParameters["password"]); var user = DataBridge.LogInUser(email, password); if (user != null) { var session = new Session() { Id = new Random().Next().ToString(), User = user }; Header.AddCookie(new Cookie("sid", session.Id)); DataBridge.AddSession(session); DataBridge.SaveChanges(); } }