MySQL wait_timeout Variable – GLOBAL vs SESSION

Your session status are set once you start a session, and by default, take the current GLOBAL value. If you disconnected after you did SET @@GLOBAL.wait_timeout=300, then subsequently reconnected, you’d see SHOW SESSION VARIABLES LIKE “%wait%”; Result: 300 Similarly, at any time, if you did mysql> SET session wait_timeout=300; You’d get mysql> SHOW SESSION VARIABLES … Read more

How to use sessions in an ASP.NET MVC 4 application?

Try //adding data to session //assuming the method below will return list of Products var products=Db.GetProducts(); //Store the products to a session Session[“products”]=products; //To get what you have stored to a session var products=Session[“products”] as List<Product>; //to clear the session value Session[“products”]=null;

How to access session variables from any class in ASP.NET?

(Updated for completeness) You can access session variables from any page or control using Session[“loginId”] and from any class (e.g. from inside a class library), using System.Web.HttpContext.Current.Session[“loginId”]. But please read on for my original answer… I always use a wrapper class around the ASP.NET session to simplify access to session variables: public class MySession { … Read more

How do servlets work? Instantiation, sessions, shared variables and multithreading

ServletContext When the servlet container (like Apache Tomcat) starts up, it will deploy and load all its web applications. When a web application is loaded, the servlet container creates the ServletContext once and keeps it in the server’s memory. The web app’s web.xml and all of included web-fragment.xml files is parsed, and each <servlet>, <filter> … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)