Unable to make the session state request to the session state server?
Asked Answered
E

1

10

I am trying to use State Server sessions.

I have changed my Session state to the following:

<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" cookieless="false" timeout="20" />

Running my website from local host and everything works fine.

But when i publish my website and try run it online i get the following error:

Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection. If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.

The website is hosted on Afrihost servers, after resarching the error i found that it could be because ASP.NET State service has not been started. Is there a way i could check if the Afrihost servers are running this service or to start it remotely?

Also i know the IP address 127.0.0.1 is for local host, but because you are publishing your application on webserver it becomes local to that machine is this correct.

Endo answered 16/10, 2013 at 13:37 Comment(2)
Can you make an RDP connection on the server ? If so, make sure the service is properly started (in services.msc) and if it doesn't start correctly, check the Windows event logAlbedo
@CharlesAD I don't think Afrihost allows RDP connections to there server, as they host most website for south africa.Endo
E
23

That error message means the ASP.NET State service is not running.

Your connection string should always be stateConnectionString="tcpip=127.0.0.1:42424" As wherever the site is hosted that will be the local machine.

After contacting Afrihost and asking them to restart the Service everything started to run fine.

enter image description here

Endo answered 17/10, 2013 at 13:15 Comment(4)
Yes, that's the correct answer. Please follow above suggestion. :)Jost
Also make sure to set the Startup Type to Automatic, so you don't need to change it every time the server restarts.Endo
i have the same error and cannoit start the service how it can be resolveFreedafreedman
Unbelievable. WorkedTaejon

© 2022 - 2024 — McMap. All rights reserved.