Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- how to use session/cookie in website written in C# ( Visual Studio 2010)
- public static bool EditUserInfo(string strCookieName, string password)
- {
- string query = "UPDATE usertb SET password = '" + password + "' WHERE username = '" + Name + "'";
- accessDB dbaccess = new accessDB();
- return dbaccess.saveData(query);
- }
- string id = Session["mysession"].ToString(); //GET
- Session["mysession"] = "Hello World"; //SET
- HttpContext.Current.Request.Cookies["RememberLoginName"].Value //GET
- HttpContext.Current.Response.Cookies.Add(new HttpCookie("RememberLoginName", ValueforCookie)); //SET`
Add Comment
Please, Sign In to add comment