473,624 Members | 2,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session State Variables not being persisting correctly

Hi, I have developed a project on my local machine. The session state
variables are working fine on my local machine. When I port it into a
another server called v-projects, and I try to run the project from
that other server, the session state variables are being set randomly.
For example, in the following code:

SetSelectionSes sionState();
Response.Redire ct(@"http://localhost/WebTemplateExam ple/MainPage.aspx?N avLink=Selectio nStep2&Type=Rep ortGenerator",
true);

After I set the session state, I redirect to another site. The
variables are lost after this. However, the strange thing that is
happening is that sometimes it will keep the variables, but sometimes
it will not. I have no idea why this is happening on the other server,
when it is working fine on my local machine. Please help!
Nov 18 '05 #1
1 1779
Are you by any chance experiencing this issue on a machine that is
running with multiple processors running Windows Server 2003 (or even
just IIS6 on Win2K3)? I ask because what you are describing is what
happens in those types of environments when web gardens are being used
(it can also happen in non-sticky IP web farms).

Session is worker process based unless you change the web.config to
enable StateServer or SqlServer based session state. When you have
multiple worker processes (as in Win2K3/IIS6 web garden configuration)
you have separate worker processes that could potentially handle each
request that the user makes, this in turn causes the Session to behave
erratically.

You don't normally experience this on a development box because people
so rarely develop on similar hardware as they deploy to (though they
really should) and as such they often have only a single worker process
running which in turn means they don't experience this problem.

Be careful if you decide to use StateServer or SqlServer to handle this
issue because it requires any objects that you put in session to be
serializable in order to pass them across the process boundary.

Have A Better One!

John M Deal, MCP
Necessity Software

yoshibebe wrote:
Hi, I have developed a project on my local machine. The session state
variables are working fine on my local machine. When I port it into a
another server called v-projects, and I try to run the project from
that other server, the session state variables are being set randomly.
For example, in the following code:

SetSelectionSes sionState();
Response.Redire ct(@"http://localhost/WebTemplateExam ple/MainPage.aspx?N avLink=Selectio nStep2&Type=Rep ortGenerator",
true);

After I set the session state, I redirect to another site. The
variables are lost after this. However, the strange thing that is
happening is that sometimes it will keep the variables, but sometimes
it will not. I have no idea why this is happening on the other server,
when it is working fine on my local machine. Please help!

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1696
by: adam | last post by:
Having spent nearly 2 years in win forms land the inevitable request came for me to "do some web pages". So being new to this bit of .net and having had a look around I can't see where the best way to store session data. 1) use the (string)Session approach Obviously bad for maintenance, readability etc. 2) have a typed MySession object with static properties for each value I want to store
5
4132
by: Marc Rivait | last post by:
Here is a very interesting scenario. I have a simple test application that loads a page and sets a session variable on the load event. On the first page there is a link to a second page. The load event of the second page displays the value of the session variable. The problem is that when I use a W2k machine, this little test works perfect. Session variable value is displayed on the second page. However, when I use my XPPro...
14
2254
by: Venkat Chellam | last post by:
I have a peculiar problem. I have a simple web application which loads some data from the oracle table and display in the datagrid in the webpage and datagrid has page enabled which shows 10 rows at a page.I have a search criteria to search the records based on the data range i give This is what i have done, in the !IsPostBack section. I am setting up the oracle connection, creating dataset object, datadapter and i aslo load the data...
7
1853
by: Gerald | last post by:
Hi, Is there any know problem using session variables ? My website won't have more than 20 simultaneous connections, and i would like to use 5 session variables containing strings... I know than with ASP, it was not really recommended, what about ASP.NET ? Thanks !
10
3499
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much more time I have on a session? If I do a refresh, does reset the session clock? Do you have have to go to another page to reset the session timeout or will a postback also do it? This is important as we have a few pages that a user
9
5302
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of copy paste (I hear this will improve in ASP.Net 2 via master pages). When I navigate from one page to the next the header and footer user controls lose their state because they are effectively different instances of the user control. Is there...
4
4331
by: Sam | last post by:
I have an asp.net 2.0 app that uses a sitemap, Master Page, and has several content pages. While this feature has simplified the process of creating a data-driven site menu, it does seem to have some big restrictions. Namely, maintaining state on the Master Page across all content pages. I simply want to keep track of a key value across all content pages. The only solution I can come up with is using a session variable, which I hate.
2
4243
by: maxkumar | last post by:
Hi, I am running a ASP.NET 1.1 site on Win Server 2003 with IIS 6.0. The website has been running for about 1.5 years now. In the past, we used to have random cases of session variables getting lost, but not frequently. However, since the past 2 weeks, I am noticing an alarming increase of such session variables lost cases. My application log shows about 20-30 such errors every day. We have not changed anything at the server for a long...
0
8177
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8681
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7170
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4183
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2611
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.