Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




.NET/ASP.NET Interview Question -What role does Session object play?

.NET/ASP.NET Interview Question -What role does Session object play?

Answer:

HTTP is a stateless protocol; it can't hold the client information on page. In other words after every request and response the server does not remember the state, data and who the user was. If user inserts some information, and move to the next page, that data will be lost and user would not able to retrieve the information.So, Session provides that facility to store information on server memory.

Below is the diagram to understand in better manner.





In the above example, when the user request the IIS server for the Page1.aspx then the request is broadcasted to the user/client browser and the connection is broken, Now when the same user request the IIS server for the Page2.aspx then again the request is broadcasted to the user/client browser but this time again the same user is treated as a new user as the connection was broken by IIS server after displaying the Page1.aspx page.

Note:-
So every single time a new request is made the same user is treated as a new one, so in order to maintain this we need Sessions.

Regards,

Please click here to see more .NET/ASP.NET interview questions

Share this article   |    Print    |    Article read by 1292 times
Author:
Shivprasad koirala Koirala
I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small E-learning company in India. We are very much active in making training videos , writing books and corporate trainings. Do visit my site http://www.questpond.com for .NET, C# , design pattern , WCF , Silverlight , LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server training and Interview questions and answers
Related Articles: No related article
Related Interview Questions: