Click here to Skip to main content
15,914,642 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have recently changed the session state mode from ‘inproc’ to ‘stateserver’.
Now I am losing the values added in HttpContext.Current.Session via a .ashx HttpHandler file. The Handler.ashx has System.Web.SessionState.IReadOnlySessionState interface implemented.

When I change the session state mode to ‘InProc’, the values added to the Session via the Handler are available for later requests.
However, when I set the session state mode to ‘StateServer’, it seems that the values are not available in other pages.
Could someone please let me know why this is occurring and the solution for the same.
Posted
Comments
Mukesh Ghosh 13-May-14 9:55am    
Have you added your state server address in config file?
Can you paste your config file here?
smodak@ats360.com 15-May-14 2:47am    
This is the setting I have made in the config file
(sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="300")

1 solution

XML
Step 1: In System.Web configuration section of web.config add following

<sessionState cookieless="UseCookies" timeout="1440" mode="StateServer" />

Step 2: From Control Panel => Administrative tools => Services, start the service called as "ASP.NET State Service"

thats it.
 
Share this answer
 
Comments
smodak@ats360.com 16-May-14 6:24am    
I have already started ASP.NET state service when I have changed the session state mode from ‘inproc’ to ‘stateserver’.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900