Some of my colleagues told me that session consumes lots of memory to the server.
What must I do to effectively used my sessions with minimal consumptions of memory in the server?
Can I pass the data from my sessions to a global variable so that it will not consumes lots of memory in the server?
ex.
after reading my session:
can I do this so that my other pages can also redirect to the default page if the session["username"] has no value:Code:string username = (string)Session["username"]; if (username == null || username.Length == 0) { Response.Redirect("~/Default.aspx"); }
so that instead of using the above code, I am going to do this:Code:GlobalVariable.username = (string)Session["username"];
Thank you all!Code:if (GlobalVariable.username == null) { Response.Redirect("~/Default.aspx"); }


Reply With Quote
