Edited by Nancy Michell
MSDN Magazine November 2005
View Complete Post
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.
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.
MSDN Magazine September 2005
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.
MSDN Magazine October 2000
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.
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 clie
I'm developing Visual Studio 2010 solution for site pages. I’ve created Site Pages in SharePoint 2010 and I’m trying to access Session variables in code
behind in ASP.NET but it throws the following error.
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please
also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration.
I set the page directive as
I have a need to encrypt query string elements but I want to use a per session key. I don't want the user to come back later with the same querystring and be able to use it again. I created an IHttpModule for decrypting the querystring elements (derived from QueryStringModule.cs that's floating around). The problem is the first time through the session is null (as expected since it is a new page request). Is there a way to force session to be active here?
public void Init(HttpApplication context)
context.BeginRequest += new EventHandler(OnBeginRequest);
void OnBeginRequest(object sender, EventArgs e)
HttpContext context = HttpContext.Current;
string key = (string)context.Session["sessionkey"];
In this case, context session is null.