ASP.NET session state enables you to store and retrieve values for a user as the user navigates ASP.NET pages in a Web application. HTTP is a stateless protocol. This means that a Web server treats each HTTP request for a page as an independent request.Session is defined as the period of time that a unique user interacts with a Web application. When a new user begins to interact with the application, a new session ID is generated and associated with all subsequent requests from that same client and stored in a cookie on the client machine.
- 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.
Related Posts:
How To Bounce Left a div by Using jQuery plugin And use in Asp.Net.
Here i will explain how to move or bounce a particular division by using jquery.
Here i will use .velocity() function instead of $.animate() animation engine.
Velocity is a animation engine that re… Read More
Freeze GridView Header Row In Asp.Net
In Grid View Control You Can easily display all the collection of data and we can easily add sorting and paging, and perform in-line editing.Some time there is large no of data which makes grid view scro… Read More
Online Examination
Here I Will Explain How to create a simple Online Examination Form by using c# in Asp.Net
protected void Button1_Click(object sender, EventArgs
e)
{
HttpC… Read More
Custom Validator(Client Side)
Here I will explain how to use customer validator in a asp.net project to validate a controls.
<head runat="server"> <title></title> <script type="text/javascr… Read More
3 Tire Architecture.
3-Tier architecture is a very well know
buzz word in the world of software development whether it web based or desktop
based. In this article I am going to show how to design a web application based
on 3-tier architecture… Read More
0 comments::
Post a Comment