- Session state is maintained in an instance of the HttpSessionState class and is accessible through the Session property of both the Page and HttpContext classes. It is not necessary for you to instantiate the Session Object. An instance is automatically provided for you. The Session object allows you to maintain a list of name/value pairs that can be accessed by any Web page in your application.
C#
string Username; if (Session["Username"] != null) { Username = (String)Session["Username"]; } else { Session["Usernames"] = "Ashok";}
For every client Session data store separately, means session data is stored as per client basis. Along with advantages, some times session can causes performance issue for heavy traffic sites because its stored on server memory and clients read data from the server itself.
0 comments::
Post a Comment