Last post Jul 06, 2017 08:24 AM by Eric Du
Jul 05, 2017 11:00 AM|satyam khare|LINK
I developed one website and i used a Inproc Session in that and given a 20 min session timeout
but when i refresh the page itself after a minutes only it logout or sometime it does not logout but the data fetched from the database not show's in the controls
can anyone please help me for this
This is my web.config code
<defaultProxy enabled="true" useDefaultCredentials="true" />
<!--For a description of web.config changes for .NET 4.5 see http://go.microsoft.com/fwlink/?LinkId=235367.
<The following attributes can be set on the <httpRuntime> tag.-->
<sessionState timeout="20" mode="InProc">
<customErrors mode="Off" />
<compilation debug="true" targetFramework="4.5"/>
<add name="Constr" connectionString="Data Source=xxxxxxxxxx;Initial Catalog=xxxxxx;user Id = xxx; Password =xxxxxxxx" />
Jul 05, 2017 11:18 AM|0belix|LINK
InProc has that problem... sometimes your're logged out the second you finish loggin in... use StateServer...
Jul 05, 2017 12:53 PM|mgebhard|LINK
Session and authentication are generally two different frameworks unless you wrote custom code that stores user credentials in Session. Keep in mind, it is considered bad practice to store user credentials in Session as this approach does not extend well
and is dependent on server configuration.
Consider using ASP Identity which is a cookie based authentication.
Otherwise, as Obelix suggested, stand up a Session state server.
Jul 06, 2017 08:24 AM|Eric Du|LINK
Hi satyam khare,
According to your description, I think this issue is related to the Session-State Mode, because it will save the session value in the process, many reasons could cause the session lost.
So I suggest you could use SQLServer mode to store session, it store the session in the database, I think it is better than default mode. Here are two documents about the
difference of the different modes and how to use SQLServer mode, please check:
HOW TO: Configure SQL Server to Store ASP.NET Session State: