Session state lost every other session after conversion from 2003 to 2005

Hi,

 

I have a weird problem here I can't really place. Maintaining session state was never a problem with VS2003 but after the conversion to VS2005 I have session state problems.



I put a value in the session state in the !IsPostBack in Page_Load. After that if statement I take out that variable again just to test if it is in the session state. This goes ok for the first time I work with th e application. If I then close the browser and go to it again this fails. After the postback the webapplication doesn't enter the !IsPostBack if statement but the variable is also not in the Session state???

 

This happens every other time. First time running the webapplication-->OK ; Second time running the webapplication-->FAIL; third time-->OK;fourth time-->NOT OK.

This behaviour started after conversion to VS2005 but what even controls such a strange behaviour? What can go wrong after a postback that 50% of the time the Session state is lost?

PS: behaviour happens on the VS2005 internal webserver and IIS 6 and I have tons of memory. So I doubt it's the webserver causing this. 

0
PulsatingQuasar
8/29/2006 3:31:10 PM
asp.net.state-management 8807 articles. 0 followers. Follow

12 Replies
601 Views

Similar Articles

[PageSpeed] 12

PulsatingQuasar:
If I then close the browser and go to it again this fails.

You are suppose to lose Session after the browser is closed.


Cheers,
       Kevin Jones


0
vcsjones
8/29/2006 11:42:08 PM

I know. That's not what I meant.

After I open the browser again(second time) a new session will start and offcourse the variable will be put in the session state again in the !IsPostBack if. But if I then do a postback the session state is lost. And this happens every other time.

If I then open the browser a third time the variable is put in the session state again ofcourse and after doing a postback it is still there as expected.

The fourth time I open the browser the variable is put in the session state( just as before); then doing a postback and the session state is lost again. 

 Nothing fancy is going on and this behaviour started right after conversion to VS2005.
 

0
PulsatingQuasar
8/30/2006 7:14:50 AM

I now see that between clicking a button on the form to initiate the posback and before the breakpoint in the Page_Load the application seems to crash.

 

I just noticed this because my application created directories for each Session and these directories are cleanedup in the Application_Start in global.asax. I just noticed that sometimes after a post back these directories were gone. This can only happen in Application_Start which would mean a crash in the application. But why there is no exception???????

0
PulsatingQuasar
8/30/2006 9:55:28 AM

OK, I have found out what causes it but haven't found out why!

 

I have 2 applications. One behaves and the other doesn't. I suddenly noticed that I clean directories with the application that behaves itself in the Application_Start and I clean directories in the misbehaving application in Session_Start. That was actually a mistake but I don't understand why cleaning directories in Session_Start is such a problem and why the problem manifests itself after the first postback and why there is no exception informing you that the application had to restart.
 

0
PulsatingQuasar
8/30/2006 12:06:45 PM
Ah. That explains it. That is because if you change any file in the Application Directory in ASP.NET 2.0 the AppDomain is reststarted. In the .NET Framework 1.1, it was just the bin directory that caused that behavior.
Cheers,
       Kevin Jones


0
vcsjones
8/30/2006 2:12:49 PM

Wait a minute!!!!

For both webapplications I have a storage directory outside the application directory and an upload directory inside the application directory.

If I move that upload directory elsewhere I can cleanup files from Session_Start aswell without an AppDomain restart????

 

Is there also a way to tell runtime to not do that for every file and go back to 1.1 behaviour? Cleaning directories at every session_start might also be nice to keep

the garbage collecting down. 

0
PulsatingQuasar
8/31/2006 2:02:27 PM
Hmm, is there anything in the Event Viewer that might indicate a problem?
Cheers,
       Kevin Jones


0
vcsjones
9/2/2006 4:37:22 PM

Nothing.

I could quickly test if not deleting files in the Upload directory makes a difference. If so then it must be what you said. That all files in the application directory are monitored and if changed the appdomain restarts.
 

0
PulsatingQuasar
9/4/2006 8:27:13 AM

OK, I tested it. First I removed cleaning of files in the upload directory. The application continued to work properly.

Then I turned it the other way round( cleaning in the upload directory but not in the download directory). Then it went wrong again. It seems you are right!

 Should I mark your answer as the answer or.....?
 

0
PulsatingQuasar
9/4/2006 8:37:54 AM
Yes, but let me go ahead and dig around for another solution for you.
Cheers,
       Kevin Jones


0
vcsjones
9/4/2006 12:04:42 PM

Hi

In asp.net 2.0 you loose session as soon as there is some changes to file structure in the virtual directory.

look at this post

http://vikramlakhotia.com/Post.aspx?postID=6

Vikram

http://vikramlakhotia.com/ 


Vikram
www.vikramlakhotia.com


Please mark the answer if it helped you
0
vik20000in
9/13/2006 10:21:04 AM

please help

 

i have the same problem

i've been trying to trackit for so long

I migrated from 1.1 to 2.0 and when i login to my application, and then navigate to another page sometimes i loose the session and sometimes i dont!!

 

I'm in bad need of help

 

 

0
Ankofy
3/28/2007 11:03:45 PM
Reply:

Similar Artilces:

Visual Studio 2005
 Hi, I have recently been given a PC with Vista on it, and installed Visual Studio 2005 pro. I then moved a ASP.net web project from an XP machine to the Vista one. When I run the project from inside Visual Studio (debug mode) everything works fine on the front end of the website, but if I try and log in I get the following error:  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 i...

The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increas
Hi.. I am making a mobile application using .net framework 2.0. My Application has  web farm scenario so for state management  I am using Sateserver in my application. My application runs fine if I dont use web farm scenario But in case of web farm scenario it is giving me error "The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increasing the history size or session expiry limit."   &...

"The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increa
Hi.. I am making a mobile application using .net framework 2.0. My Application has web farm scenario so for state management I am using Sateserver in my application. My application runs fine if I dont use web farm scenario But in case of web farm scenario it is giving me error "The page requires session state that is no longer available. Either the session has expired, the client did not send a valid session cookie, or the session state history size is too small. Try increasing the history size or session expiry limit." I am not getting why this error is coming ..Though I already h...

Unable to make the session state request to the session state server
Hi all, I'm working on the website http://universityauction.net and I was using session variables using InProc session mode to manage session state. This worked fine until I put the website in a load balanced environment, as inproc sessions get lost when jumping from server to server. I decided to move to a state server mode, so I changed my web.config to: <sessionState             mode="StateServer"             stateConnectionString="tcpip=123.456.7.8:42424"      ...

Unable to make the session state request to the session state server.
 Hello,           I’m receiving this error when I put my website on production."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 men...

Unable to make the session state request to the session state server etc.
We are getting an error message "Unable to make the session state request to the session state server..." sporadically in one of our applications.  We have several applications running on a 4-server web farm, and these applications have been in production for a year, so it is not a problem that the server is not reachable, not started, not addressed correctly, etc etc etc. One of the applications *does* put a lot of large datasets into session state.  Is there a limit on the allowable size of a session/cached object?  Also, the application opens several windows at once, ...

Unable to make the session state request to the session state server #2
We have recently started receiving these errors in the event viewer. We are using the out of proc state server on the same machine. The errors become more frequent, almost like it snowballs until users cannot work. System Info: Windows Server 2003 Standard SP2 , 4 GB of RAM, IIS 6.0, Asp.Net 2.0. What I know for certain: The state server is started and running Recycling the app pool nor restarting IIS fixes the problem Rebooting the machine DOES temporarily fix the problem. I changed the stateNetworkTimeout from 10 to 20 in webconfig and that had no effect. There is usuall...

Error: Unable to make the session state request to the session state server
I have session configured in web.config this way:<sessionState mode="StateServer" cookieless="true", timeout="30" stateConnectionString="tcpip=127.0.0.1:42424" />  ASP.NET State Service is started.   I got an error:  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\CurrentContr...

Unable to make the session state request to the session state server
 We have a web application in our school called CHECM. We are experiencing a high volume of ASP.NET State Server errors throughout this month. These errors have been occurring since 7/11/2006.   Our Session State Mode has been --------------------------------------------------------- <sessionState mode="StateServer" stateConnectionString="tcpip=CHECM:42424" timeout="20" stateNetworkTimeout="30"/>     Here is the Error we get randomly Exception: System.Web.HttpException Message: Unable to make the session state request to the session state server. P...

Error message
Hello,I have developed an ASP.NET c# application.I have a "Reports" page in which i put the the report's DataTable in a session (to use it later on for paging and sorting).This works on my localhost but on production I get the follwong error: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\Servic...

Session state not working when application state does in sharepoint portal server 2003
Hi,  I have an application which is embedded in SharePoint with the Page Viewer web part. I have a couple of Session state variables which i set during the applications lifetime. The problem is that when I use Session["something"] it get lost but if I use Application["something" it persist. Anyone have a guess to why I'm experiencing this with SharePoint. Btw I have no problems with the Session variables if I run it outside SharePoint. TIA Brother,i am also facing same issue,if u found any solution please post it hereRegardsVijay Hi Vijay, I have no...

Session State and View State
Hi Everyone, Can anybody tellme how are these used in context with ASP.NeT whats their sole purpose?.....and where in programming we use  them? Any links or sources would be good which explains in simple terms.   thanks Simi  ThanksSimi------------&------------"To learn to succeed, you must first learn to fail." -Michael Jordan Here is one of the discussion http://forums.asp.net/t/1145838.aspxMPI never desire to converse with a man who has written more than he hasread. -Samuel Johnson, lexicographer (1709-1784)  Hi There is a video tutorial a...

Unable to use session state server....requires session state server version 2.0 or above.
So, I have Windows 2003 IIS latest service packs running. Its running .NET 2.0 and .NET 1.1 applications in seperate application pools. Just today I applied the following patch to the server. (The server is not running any 3.0 or 3.5 applications or application pools)  Microsoft .NET Framework 3.5 Service Pack 1 and .NET Framework 3.5 Family Update (KB951847) x86 Microsoft .NET Framework 3.5 Service Pack 1 is a full cumulative update that contains many new features building incrementally upon .NET Framework 2.0, 3.0, 3.5, and includes cumulative servicing upda...

Usage scenarios for view state, session state, application state, cookies
Hi Guys, Im a college student in London with exams starting Monday on ASP.NET with C#.  Id be so grateful if you could provide me with solid real world scenarios/examples of when you would use the following to maintain state and why you would use them in that instance:   View State Session State Application State Cookies Also when would you use SOAP instead of the REST architecture and vice versa and why - again real world usage scenarios?  I note Amazon's web service uses the REST architecture - why is this, why dont they use SOAP. Id be grateful for a timely respon...

Web resources about - Session state lost every other session after conversion from 2003 to 2005 - asp.net.state-management

Gene conversion - Wikipedia, the free encyclopedia
Gene conversion is the process by which one DNA sequence replaces a homologous sequence such that the sequences become identical after the conversion ...

Sonny Bill Williams' transformation due to conversion to Islam, Anthony Mundine says
He went from being savaged for walking out on the Bulldogs to becoming one of the world's most respected rugby union stars. Anthony Mundine believes ...

Family of Enrique Marquez unaware of his 2014 marriage, conversion to Islam
The family members of Enrique Marquez, the man linked to the San Bernardino massacre, said they were unaware he was married or that he had converted ...

Revisiting Carlos Martinez's rotation conversion
... thanks to his pitch mix, then it sure sounded like it could be possible. Now, almost a full year later, I wanted to revisit Martinez's conversion. ...

Dow to Force Conversion of Buffett Preferreds If Rally Holds
Bloomberg Dow to Force Conversion of Buffett Preferreds If Rally Holds Bloomberg Dow Chemical Co., which has been paying $255 million annually ...

​Judge orders N.J. "gay conversion" nonprofit to close
Jews Offering New Alternatives for Healing, known as JONAH, ordered to cease operations within 30 days

Tory MP: 'It is time to make gay conversion therapy illegal'
Gay-conversion therapies were debated in the house of parliament this afternoon with one Conservative MP calling for legislation to make them ...

Roth conversions can be a bad idea
When it comes to Roth conversions, consider the most important — and often overlooked — factor: state income taxes.

Del Rio explains why Raiders went for late two-point conversion
... A's Sharks Warriors Kings 49ers Raiders Quakes Insiders More Tickets Shop Watch Del Rio explains why Raiders went for late two-point conversion ...

Get a free copy of powerful DVD ripping and video conversion software
DVD players are going the way of the Walkman, leaving many of us with vast libraries of obsolete discs. Of course the movies and TV shows themselves ...

Resources last updated: 12/21/2015 10:22:01 PM