visual studio - ASP.NET Session-State InProc -


why creating asp.net 4.5 web forms project in visual studio 2012 have following in web.config default:

... <connectionstrings>   <add name="defaultconnection" providername="system.data.sqlclient" connectionstring="data source=(localdb)\v11.0;initial catalog=aspnet-project.web-20130625130806;integrated security=sspi;attachdbfilename=|datadirectory|\aspnet-project.web-20130625130806.mdf" /> </connectionstrings> ... <sessionstate mode="inproc" customprovider="defaultsessionprovider">   <providers>     <add name="defaultsessionprovider" type="system.web.providers.defaultsessionstateprovider, system.web.providers, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" connectionstringname="defaultconnection" />   </providers> </sessionstate> ... 

(my question not localdb or why there's sample connection string)

it says here inproc means session state stored in memory. why need specify connection string once you've declared inproc?

the <connectionstrings> section shown above <sessionstate> section in no way connected sessionstate. connectionstrings section other purposes when have own database , need connect section contains details of database used membership, profiles etc.

the <sessionstate > element has own settings specifying connections string named: sqlconnectionstring seen below:

<sessionstate mode="off|inproc|stateserver|sqlserver"               cookieless="true|false"               timeout="number of minutes"               stateconnectionstring="tcpip=server:port"               sqlconnectionstring="sql connection string"               statenetworktimeout="number of seconds"/> 

now when use mode="inproc", there no need set sqlconnectionstring setting. if set, not used mode "inproc" & not " sqlserver"


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -