Last post May 28, 2019 02:15 AM by Ackerly Xu
May 25, 2019 06:20 PM|hamed_1983|LINK
i'm facing some problems!
Where is the problem and how to solve it ?
Updated : I've used shared hosting & i think this caused the problem. after some search, i've add sessionSate tag in web.config as follow :
<sessionState mode="InProc" timeout="20" ></sessionState>
but my problem was not solved. Also after contacting with my hosting provider, they could not make changes to my appPool.
Can anybody help me how to work around this problem ?
thanks in advance
May 26, 2019 12:51 PM|yogyogi|LINK
<sessionState mode="InProc" timeout="20" cookieless="true"></sessionState>
May 26, 2019 04:21 PM|hamed_1983|LINK
Thanks for reply
I've add your advise without cookieless attribute, now add this attribute and test again and not working!
Also, after adding cookieless attribute, i'm facing some errors such as "Authentication Faield : invalid operation exception!"
May 27, 2019 03:20 AM|Ackerly Xu|LINK
If you are using web farm, session state in proc will not work, because your session data will stored separately in all your servers.
If you store session in one server and then the user visits another server , the server will not have the session data.
So you should use session in state server or sql server.
To learn how to configure session state , you could refer to
May 27, 2019 10:44 AM|hamed_1983|LINK
Your advise was very well to me, I found out to solve my problem, should using either 'StateServer' or 'SqlServer'. (i've focus on SqlServer mode and have found this useful
link), but because my site hosted on shared hosting provider, i could not access some server features, like jobs, or services. Also, i want to use the same database which i used in my site, instead of create a custom database for storing session data. So
Thanks in advance
May 28, 2019 02:15 AM|Ackerly Xu|LINK
You should use aspnet_regsql.exe to help create session state tables in your database.
Usually it is in C:\Windows\Microsoft.NET\Framework64\your framework version> or C:\Windows\Microsoft.NET\Framework\your framework version>.
Then use cmd to enter this folder and input command
aspnet_regsql.exe -S [your server ip] -U [username] -P [password] -ssadd -sstype c -d [databasename]
then you database should have two extra tables ASPStateTempApplications and ASPStateTempSessions, you could set -d parameter to your website's database and you don't need to create a new database.
Then you could configure sessionstate in your web.config.
<sessionState mode="SQLServer" sqlConnectionString="server=[your server];database=[database name];uid=[username];pwd=[password]" allowCustomSqlDatabase="true" cookieless="false" timeout="20" />
You had better use username + password instead of windows authentication, because you have several servers.
If you don't have a user in your database, please refer to
Also refer to