Due to the known problem of session variables getting lost if using InProc-server during frequent changes in development, I had to choose between SQL and ASP.NET State server, so I opted for the second. Initially, all fine, but after using it for a few days,
I started to get this error:
Server Error in '/cv2' Application.
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.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: 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.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): 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.]
System.Web.SessionState.OutOfProcSessionStateStore.MakeRequest(StateProtocolVerb verb, String id, StateProtocolExclusive exclusiveAccess, Int32 extraFlags, Int32 timeout, Int32 lockCookie, Byte[] buf, Int32 cb, Int32 networkTimeout, SessionNDMakeRequestResults&
results) +1565
System.Web.SessionState.OutOfProcSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +192
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +355
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Meanwhile the event log on the server (W2K2003) always logged this error (rI've emoved some details from it):
Event code: 3009
Event message: Unable to make the session state request to the session state server. Details: last phase='Reading response from the state server', error code=0x8007274C, size of outgoing data=45999
Event time: 9/29/2006 11:40:17 AM
Event time (UTC): 9/29/2006 3:40:17 AM
Event ID: 0ec55d45b61f457d95d3d3c256d7cab7
Event sequence: 4
Event occurrence: 1
Event detail code: 50016
Process information:
Process ID: 720
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: HttpException
Exception message: 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.
Request information:
Request URL: **********
Request path: **********
User host address: 192.168.0.181
User: **********
Is authenticated: True
Authentication Type: Forms
Thread information:
Thread ID: 1
Is impersonating: False
Stack trace:
I also saw a lot of abandoned posts asking about lost session state on this forum when searching. Some suggested increasing the time out, which I believe had nothing to do with the issue.
The state service configuration worked fine when running on the development machine, and I was 100% sure the asp.net state service had the correct and same port numbers.
I also tried the latest VS 2005 SP1 beta on dev. machine and server but no effect on the issue (although it solved some other bugs).
I also tried setting the ASP.NET state server registry key to accept remote connections (flag to 1 instead of 0), but no effect.
Interestingly enough, I have not uninstalled the .NET 1.1 framework, and the server is a plain 32-bit platform, so the title was pretty misleading.
So I "adapted" the hotfix to:
1. change dir to: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
2. type aspnet_regiis -i -enable|
3. Machine chews command for about 1 minute or so
4. Done! When I click "log in" button on the start page with correct credentials, the session state is working fine again.
And actually, that's all!
Apparently, the ASP.NET 2.0 framework with IIS was corrupted, but I can't recall any particular action that specifically broke it, except that I did a system restart, which may have triggered some pending action initiated long ago.
Would be interesting to know if this solves the problem for others who have the same issue.
1. change dir to: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
2. type aspnet_regiis -i -enable|
3. Machine chews command for about 1 minute or so
4. Done! When I click "log in" button on the start page with correct credentials, the session state is working fine again.
I wanted to use the StateServer for storing sessions in a web farm scenario. To start with, I tried initally on one server where I ran the client and host on the same machine and I added the following code in web.config:
I just moved my web sites to a new local Windows Small Business Server 2003 and got the same error when I tried connecting to a site with a login screen, after logging in. (The site was built with Visual Studio 2005, using ASP.NET 2.0.50727.)
I tried the solution in this article and got a different error when I refreshed the web page (Validation of viewstate MAC failed...). So I closed the browser window (on a client in the same LAN) and tried
again, then got the original error again.
The solution I found is this:
On the server, go to Administrative Tools – Services:
Service: "ASP.NET State Service" had Startup Type set to Manual, and was not running.
Changed Startup Type to Automatic, and started it. (Right-click on “ASP.NET State Service” – Properties to change settings). Then it worked.
I've got the 100% same problem with only difference that it crashes immediately when I'm trying to write something to session, but works ok when I'm reading it. I've reinstalled iis asp.net config like you described but it didn't help. Any suggestions ?
I got the same error again, 2 years later, just after I did an automatic security update to Microsoft .NET Framework. I looked in Services at "ASP.NET State Service". It was automatic, but it didn't say it was started. So I started it and then my web site
worked again.
I got this error again, but for a different reason. I have an ASP.NET web site using ReportViewers. Since the report definition can't be changed for a ReportViewer control, I had 1 control for each report definition on the web page. Depending on which report
the user selected, I had to hide unused reportviewer controls, make the selected one visible, and manage the other properties of them. When I got to 5 different reports, I decided to do something different. I put a Literal control on the page, and made a different
page with a single ReportViewer control. Now when the user selects a report I just put the page containing the ReportViewer in the Literal and it works with just one ReportViewer. But the downside of this is after bringing up about a dozen reports, the web
site bogs down. Continuing to pull up reports causes the error (Unable to make the session state request to the session state server). I sometimes get other errors (Exception
of type 'System.OutOfMemoryException' was thrown.). This occurs on an individual session basis; one user can get bogged down and other users are fine. The server did not have problems; no exceptional processor, memory, or network
usage occurred.
Apparently when the ReportViewer is in an embedded page, its view state never gets cleared. So all previous reports remain in memory for each session. To get around this problem, I executed Session.Clear(). This will clear out all session variables also,
so I had to put session variables into local variables, execute Session.Clear(), then write session variables back.
HiTech2k
Member
48 Points
20 Posts
Good news for those of you who get "Unable to make the session state request to the session state...
Sep 29, 2006 04:14 AM|LINK
Dear all,
Due to the known problem of session variables getting lost if using InProc-server during frequent changes in development, I had to choose between SQL and ASP.NET State server, so I opted for the second. Initially, all fine, but after using it for a few days, I started to get this error:
Server Error in '/cv2' Application.
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.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: 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.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): 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.]
System.Web.SessionState.OutOfProcSessionStateStore.MakeRequest(StateProtocolVerb verb, String id, StateProtocolExclusive exclusiveAccess, Int32 extraFlags, Int32 timeout, Int32 lockCookie, Byte[] buf, Int32 cb, Int32 networkTimeout, SessionNDMakeRequestResults& results) +1565
System.Web.SessionState.OutOfProcSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +192
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +355
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Meanwhile the event log on the server (W2K2003) always logged this error (rI've emoved some details from it):
Event code: 3009
Event message: Unable to make the session state request to the session state server. Details: last phase='Reading response from the state server', error code=0x8007274C, size of outgoing data=45999
Event time: 9/29/2006 11:40:17 AM
Event time (UTC): 9/29/2006 3:40:17 AM
Event ID: 0ec55d45b61f457d95d3d3c256d7cab7
Event sequence: 4
Event occurrence: 1
Event detail code: 50016
Application information:
Application domain: /LM/W3SVC/1/Root/cv2-4-128039748000937500
Trust level: Full
Application Virtual Path: **********
Application Path: **********
Machine name: **********
Process information:
Process ID: 720
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: HttpException
Exception message: 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.
Request information:
Request URL: **********
Request path: **********
User host address: 192.168.0.181
User: **********
Is authenticated: True
Authentication Type: Forms
Thread information:
Thread ID: 1
Is impersonating: False
Stack trace:
Custom event details:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
"Of course" the link http://go.microsoft.com/fwlink/events.asp did not help, "we're sorry" page showed up.
I also saw a lot of abandoned posts asking about lost session state on this forum when searching. Some suggested increasing the time out, which I believe had nothing to do with the issue.
The state service configuration worked fine when running on the development machine, and I was 100% sure the asp.net state service had the correct and same port numbers.
I also tried the latest VS 2005 SP1 beta on dev. machine and server but no effect on the issue (although it solved some other bugs).
I also tried setting the ASP.NET state server registry key to accept remote connections (flag to 1 instead of 0), but no effect.
It turned out this KB solved the issue:
http://support.microsoft.com/kb/919080/en-us?spid=8940&sid=global
Interestingly enough, I have not uninstalled the .NET 1.1 framework, and the server is a plain 32-bit platform, so the title was pretty misleading.
So I "adapted" the hotfix to:
1. change dir to: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
2. type aspnet_regiis -i -enable|
3. Machine chews command for about 1 minute or so
4. Done! When I click "log in" button on the start page with correct credentials, the session state is working fine again.
And actually, that's all!
Apparently, the ASP.NET 2.0 framework with IIS was corrupted, but I can't recall any particular action that specifically broke it, except that I did a system restart, which may have triggered some pending action initiated long ago.
Would be interesting to know if this solves the problem for others who have the same issue.
jlc321
Member
4 Points
3 Posts
Re: Good news for those of you who get "Unable to make the session state request to the session s...
Jan 03, 2008 12:35 PM|LINK
Awesome, Dude.
Thanks for the fix.
james
quoted:
So I "adapted" the hotfix to:
1. change dir to: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
2. type aspnet_regiis -i -enable|
3. Machine chews command for about 1 minute or so
4. Done! When I click "log in" button on the start page with correct credentials, the session state is working fine again.
sweetypie
Member
14 Points
34 Posts
Re: Good news for those of you who get "Unable to make the session state request to the session s...
Feb 01, 2008 12:29 PM|LINK
Hi,
I wanted to use the StateServer for storing sessions in a web farm scenario. To start with, I tried initally on one server where I ran the client and host on the same machine and I added the following code in web.config:
<
sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" cookieless="false"/>But i kept getting the error mentioned above. Then I tried the solution mentioned, but I still keep getting the same error.
Can anyone please let me know what is it that I am doing wrong and what should I do?
Thanks
Scott Nation
Member
10 Points
8 Posts
Re: Good news for those of you who get "Unable to make the session state request to the session s...
Feb 16, 2008 04:52 AM|LINK
Hello,
I just moved my web sites to a new local Windows Small Business Server 2003 and got the same error when I tried connecting to a site with a login screen, after logging in. (The site was built with Visual Studio 2005, using ASP.NET 2.0.50727.)
I tried the solution in this article and got a different error when I refreshed the web page (Validation of viewstate MAC failed...). So I closed the browser window (on a client in the same LAN) and tried again, then got the original error again.
The solution I found is this:
On the server, go to Administrative Tools – Services:
Service: "ASP.NET State Service" had Startup Type set to Manual, and was not running.
Changed Startup Type to Automatic, and started it. (Right-click on “ASP.NET State Service” – Properties to change settings). Then it worked.
Hope this helps.
Scott
server asp.NET 2.0 State Service session state
caesar
Member
34 Points
11 Posts
Re: Good news for those of you who get "Unable to make the session state request to the session s...
Mar 18, 2008 05:25 PM|LINK
2 HiTech2k
Hello,
I've got the 100% same problem with only difference that it crashes immediately when I'm trying to write something to session, but works ok when I'm reading it. I've reinstalled iis asp.net config like you described but it didn't help. Any suggestions ?
ASP.NET session state
Tasha1
Member
36 Points
65 Posts
Re: Good news for those of you who get "Unable to make the session state request to the session s...
Oct 27, 2009 10:11 AM|LINK
Thanks ! I am working on IIS 7 and just checking the Startup solved it for me!
mylaimadhu
Member
2 Points
1 Post
Re: Good news for those of you who get "Unable to make the session state request to the session s...
Aug 26, 2010 01:24 AM|LINK
Hi Scott,
Your tip works for me.
thanks for your information and shared.
rgds,
mmx
Scott Nation
Member
10 Points
8 Posts
Re: Good news for those of you who get "Unable to make the session state request to the session s...
Oct 06, 2010 03:41 AM|LINK
I got the same error again, 2 years later, just after I did an automatic security update to Microsoft .NET Framework. I looked in Services at "ASP.NET State Service". It was automatic, but it didn't say it was started. So I started it and then my web site worked again.
fomahony
Member
2 Points
1 Post
Re: Good news for those of you who get "Unable to make the session state request to the session s...
Nov 16, 2010 04:07 PM|LINK
Hi I tried the above and still got the same error.
So I went into web config file and saw seesion sate mode was set to "instate" and I changed that to "InProc" and it worked
< sessionState mode="InProc" timeout="30" />
thanks
Flor
Scott Nation
Member
10 Points
8 Posts
Re: Good news for those of you who get "Unable to make the session state request to the session s...
Apr 26, 2011 02:20 AM|LINK
I got this error again, but for a different reason. I have an ASP.NET web site using ReportViewers. Since the report definition can't be changed for a ReportViewer control, I had 1 control for each report definition on the web page. Depending on which report the user selected, I had to hide unused reportviewer controls, make the selected one visible, and manage the other properties of them. When I got to 5 different reports, I decided to do something different. I put a Literal control on the page, and made a different page with a single ReportViewer control. Now when the user selects a report I just put the page containing the ReportViewer in the Literal and it works with just one ReportViewer. But the downside of this is after bringing up about a dozen reports, the web site bogs down. Continuing to pull up reports causes the error (Unable to make the session state request to the session state server). I sometimes get other errors (Exception of type 'System.OutOfMemoryException' was thrown.). This occurs on an individual session basis; one user can get bogged down and other users are fine. The server did not have problems; no exceptional processor, memory, or network usage occurred.
Apparently when the ReportViewer is in an embedded page, its view state never gets cleared. So all previous reports remain in memory for each session. To get around this problem, I executed Session.Clear(). This will clear out all session variables also, so I had to put session variables into local variables, execute Session.Clear(), then write session variables back.