Session Objects in ASP.NET?


Session object is used to store state specific information per client basis. It is specific to particular user.Session data persists for the duration of user session.
You can disable session for a page using EnableSessionState attribute.
 <%@ Page EnableSessionState = "False" %>
You can set off session for entire application by setting mode=off in web.config file to reduce overhead for the entire application.
   
    web.config file sysntax for session:
   
    <sessionState mode = "off|inproc|sqlserver|stateserver"
       cookieless = "true|false"
       timeout = <Timeout in Minutes,default 20 mints>
       sqlconnectionstring = <SQL connection string,only required when mode=SQLServer>
       server = <The server name ,only required when the mode is State Server>
       port = <The port number, only required when the mode is State Server>      
    />

No comments:

Post a Comment