hi,
what is mean by session and give me simple example for session.
Thanks & Regards,
gokilavasan
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Mar 27, 2012, 4:32 AM EDT
Please refer the below links
http://www.c-sharpcorner.com/uploadfile/rekhasingh1610/session-object/default.aspx
http://www.c-sharpcorner.com/UploadFile/ganesh.nataraj/ASPdotNETSessionState09212005235624PM/ASPdotNETSessionState.aspx
http://www.c-sharpcorner.com/UploadFile/051e29/session-and-application-in-Asp-Net/
Thanks
SenthilkumarRank #387 · 6.5K reputationPosted Mar 27, 2012, 6:19 AM EDT
Session is server state mechanism and it is used to store the data in the memory. It is persisted across the post backs and it can be used to transfer between the pages. It is bit costly in terms of usage, because it stores data as object in the serialized format. So it needs serialize and deserialize every time whenever we store and retrieves.
The session data can be shared only for the current user. It can be shared across the pages for the current logged session. It is very easy to use.
Session["Key"] = value;
It has the key and value combination. The value can be retrieved and rewritten using the session key. The session can be abondan and killed by using key.
There are three session states.
1) InProc - Processor memory(IIS)
2) OutProc - state server
2) SqlServer - Session data will be stored in the sql server database
Drawbacks:
-----------
- Increase page pay load
- Additional overhead while serialize and deserialize
- Increase memory allocations to the server
- Microsoft suggest to use the control state rather than view state.
For more Info:
http://msdn.microsoft.com/en-us/library/ms972429.aspx