.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

using Session state server

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :ASP.Net


My ASP.NET web application is hosted in multiple servers  with a Network Load balancer Hardware. I am facing issues in session management during the site navigation. Frequently the session values are lost and application errors out with session not found. Currently the Site is configured with the Session mode as Inproc.

I would like to know:

1. Whether changing the Session mode to State server will solve the session management issue.
2. If changing the session mode then what would be the best configuration for the state server.
3. Is there any other configuration settings that needs to be done in the State server as well as in the application

Thank you

View Complete Post

More Related Resource Links

SQL Server Session state problem.


Hi to all,

I have some things that I want to know. I am right now using a free asp.net webhosting ("somee.com"). The problem is that when I am visiting a page, there's a tendency that values stored in my session variables are lost. Therefore, it causes an error when the requested page is loaded.

1. I am thinking of using sessionState mode="SqlServer". Will it solve my problem?

Actualy Im working on it but Im having problems when connecting to the sql database.

2.  Is that a problem in the webhost?

3. Do free webhosting sites provide allow session state in the sql server?. Because ive tried it locally into my computer and error say's i should intall the ASP.NET Session State SQL Server version 2.0 or above.

WCF session client service reference "State" is not updated when the server side has closed


I am using vb.net (Visual Studio 2008 with framework 3.5). I have a server that exposes several services requiring sessions. I am using wsHttpBinding for all. One of my requirements is to allow non-dot net third parties to access these services. When a client connects to a service and then some time later the server goes away, the state of the connection is still reporting "open".

Currently I have implemented a "ping" function on the server. My client calls this function every 5 to 10 seconds and if the server does shutdown, I get alerted with an exception error. This works, but I was wondering if there is a way where I don't have to call my ping function?

I don't want to use a dual connection binding and I was hoping to use the connection state variable? But, I don't know how to get it to update by itself. The client user application could just wait until it goes to invoke a service method, but I was wondering if there was another way.

Thanks in advance!!


state server for session.



  i studied like state server retrieve the session if the web server restarts.

here my doubt is application will not work while webserver restarts.then what is the use of retrieve the session after restrart the webserver?

Could not use session state server on windows 2008 R2



I am now migrating a ASP.NET web pages (.NET 2.0) to Windows 2008 R2, started IIS, SMTP, ASP.NET state server on the same machine.

Originally I have such setting on web.config, which is OK on windows server 2003.

<sessionState mode="StateServer" stateConnectionString="tcpip=" sqlConnectionString="data source=;Trusted_Connection=yes" cookieless="false" timeout="20"/>

On windows 2008 R2:

On IIS, I defined that as an Application and under  "Default Web Site", and defined a new applicaiton pool to it.

On "Default Web site", I define the session to use "InProc" and the application as "InProc", everything works fine, however, when I change the application to use "StateServer", the follow error happens:

Sample error detail:

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=0x8000FFFF, size of outgoing data=0
Event time: 10/21/2010 2:28:48 PM
Event time (UTC): 10/21/2010 6:28:48 AM
Event ID: 85f567a2371448678bf90eff3942fe62
Event sequence: 4
Event occurrence: 1
Event detail

ASP.NET version 2.0 session state not installed on SQL Server


The fix for this error message is to run aspnet_regsql -ssadd. I have run that uptown, downtown and in my lady's chamber and it does no good, although it never complains. Are there any other possibilities?


IIS Server: v5.1 running on XP.

SQLServer 2005 running on a different XP box.

Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618

There is an ASPState database on the server, containing only two tables: ASPStateTempApplications and ASPStateTempSessions. I did not use -sstype when I ran aspnet_regsql.


Session Lost Even SQL Server State


Good luck to everyone.

Imagine A project has been in the medium-sized scale contents classes in the sessions,

the SQL Server sessions seriliazed. 300-minute session in the state here;

but it losts when they dont till 300 minutes.

there are a lot of solution on the Internet, but most are guaranteed by SQL Server State and it cant be change anything.
in the meantime i havent any vps or vds just using low hosting packet web farm or web garden dont know.

by the way i had try another solution named "Defibilator" think a iframe on page and refresh every 60 second for extends session timeout. [didnt work either]

Do you think the problem is ?


 easy to come to you.


p.s : sorry for my bad english

MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

Custom Server Control Property not maintaining state


I have created a server control consisting of a TextArea and a div under it.  My goal is to create my own asp:TextArea type control.  the div is for a Character count of the text area and seems to work ok but i added a CharacterCountVisible property to the control that is always returning true.  See Proptery definition below


<Bindable(False), Category("Appearance"), DefaultValue("True"), Localizable(True)> Property CharacterCountVisible() As Boolean
        Return _CountBoxVisible
    End Get
    Set(ByVal value As Boolean)
        _CountBoxVisible = value
    End Set
End Property

Note the _CountBoxVisible variable is define inside the class as :

Dim _CountBoxVisible as Boolean = True

What I am trying to do is give the user/coder the option to show/utilize the char count feature.  Can make it disappear with textarea1.CharacterCountVisible = False but setting it to true will not make it display.


What am i missing





Best Practices: Fast, Scalable, and Secure Session State Management for Your Web Applications


ASP.NET provides a number of ways to maintain user state, the most powerful of which is session state. This article takes an in-depth look at designing and deploying high-performance, scalable, secure session solutions, and presents best practices for both existing and new ASP.NET session state features straight from the ASP.NET feature team.

Mike Volodarsky

MSDN Magazine September 2005

Taming the Stateless Beast: Managing Session State Across Servers on a Web Farm


Running a Web farm means managing session state across servers. Since session state can't be shared across a Web farm with Internet Information Services 5.0, a custom solution is required. One such solution using a tool called the session manager is described here. The article begins with a description of the SQL Server database used to store state information, the stored procedures used to update it, and the retrieval of session data. ASP code drives the session manager tool and the COM and COM+ components that run the stored procedures.

John Papa

MSDN Magazine October 2000

Session State Problem




I just for the first time into a session state problem. So I am hoping someone

here has the answer.


I have written an ASP.Net website and tried to implement the common poor mans online user count.
The problem I am having is the following.

On App_Start I create a variable and assign it the value of 0;

Then increase the number on session_start and decrement on session_end.

On my local IIS it works perfectly from IE8 and Opera. The value increments correctly.
As soon as I upload to my live server. The value increments on every link I click and every page refresh when I test with IE8.
This does not happen when testing with Opera.

Could someone please shed some light on the subject.




Louis Lews

Good news for those of you who get "Unable to make the session state request to the session state se


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 '' 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 clie

storing Session in sql server?



I want to show all the activities of the logged in user in a gridview. I am using VS 2010. please suggest some good ways of doing it.



How to use cookieless session state...

I want to know how its work and it advantage and disadvantegePls explain me with example

Session State for Listview Items?

Hi, I have a listview control, in it each item will have a checklist eg - Pass / Fail which will then have a label displaying the selected value. I also have datapager wired up to the listview. When i toggle between the datapages and toggle back, any result previously submitted will be wiped. I am thinking i should be using session state to temporarily store then info, and then once the session is finished use a submit button to send all values and ids into an xml. 1. Is this the right way of approaching the situation? 2. How would i specify session state for listview items, eg would i angle it through a itemdatabound event or the application itself?   Any assistance and advice would be appreciated as i have only started looking at state management and xml storage.  

SQL Server 2005 x64: Intermittent "Error: 18456, Severity: 14, State: 10."

Hi, We are experiencing intermittent authentication errors "Error: 18456, Severity: 14, State: 10" on a customer's production server. This is a new server that has just been rolled out in the past several months. Rebooting the server appears to make the problem go away. We are using SQL authentication from a separate server that is running IIS. The application always uses the same username and password to connect. Server info: select @@versionMicrosoft SQL Server 2005 - 9.00.2047.00 (X64) Apr 14 2006 01:11:53 Copyright (c) 1988-2005 Microsoft CorporationStandard Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 1) select @@versionSP1 Sample error from SQL Server errorlog: Date  7/7/2006 10:53:24 AMLog  SQL Server (Archive #2 - 7/7/2006 12:20:00 PM)Source  LogonMessageError: 18456, Severity: 14, State: 10. MSDN (http://msdn2.microsoft.com/en-us/library/ms366351.aspx) lists various states for this error message but 10 is not included, and it says "Other error states exist and signify an unexpected internal processing error." Note: This was not a case of a transient error that occurs only when SQL Server is starting up - these errors occurred at a variety of times, two months after the server was last rebooted / SQL Server last restarted. Thanks for any help you can provide. Regards,-Frank.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend