Session state keeps getting lost it seems....

I've had this problem for months it seems and I still haven't figured it out...  I have a large, complex SQL-driven web application with 100 or so users.  Every once in awhile users randomly get logged out and I think it's because the session is getting reset.  I can't figure out why.   I figured out one thing that was part of the problem.  I was updating the system constantly, changing dozens of relatively large files at a time, and from what I read, if you do that too oftenASP will eventually run out of ram and reset itself, losing the session state.  Apparently ASP doesn't get rid of the old versions of each assembly right away.  Anyway, I started restarting ASP every so often and the problem is greatly reduced, but at times it's still losing the session it seems.  Is there something I did that might be causing this?  Any suggestions for tracking down the problem?  The server is fairly powerful, at least a couple gigs of ram, 3.2ghz cpu, tons of disk space, windows server 2003, .net framework 1.1.  

Usually when users get logged out the whole browser locks up for awhile; I think the application is restarting itself. Other times users get logged out instantly and they can login again right away with no delay. It's weird.
0
traxonfxp
10/16/2004 4:55:20 AM
asp.net.state-management 8807 articles. 0 followers. Follow

16 Replies
656 Views

Similar Articles

[PageSpeed] 8

After reading your second para, I recall reading something like this: If you just open and save your web.config file, the application will be restarted so the user session too. So, make sure you dont change/save your config file during production runtime. 

Just curious, what kind of user authentication are you using for your site?
Rules at work:
1) Boss is always right
2) If Boss is wrong; refer rule #1
0
dotnetrook
10/16/2004 1:19:08 PM
Yep, I knew about that one.  I'm not updating the web.config each time, just the aspx, ascx and DLL's.  I'm using forms authentication.  The session seems to get lost randomly, at any time, not necessarily immediately after I update files.
0
traxonfxp
10/16/2004 6:10:50 PM
Have you tried 'StateServer' session state instead of 'InProc'?
Matt Brown
MetalReview.com - Metal music community and reviews
Haulix - Easy promotional media distribution for the music industry
0
mattb
10/16/2004 6:35:49 PM
I'm having the same problem and I'm on a much smaller system.  Sometimes even one user gets kicked off when 2 or more users are on there seems to be a lot of bouncing.

How exactly does this 'StateServer' work?
0
dsavill
10/17/2004 1:28:44 AM
Go into your Web.config file and change the session state element to 'StateServer'.  Then in IIS, you have to go into the Services utility and make sure the ASP.NET State Service is started.  Session state will run in its own separate process.  You can even start/stop IIS and not lose Session state.
Matt Brown
MetalReview.com - Metal music community and reviews
Haulix - Easy promotional media distribution for the music industry
0
mattb
10/17/2004 1:42:34 AM
Nothing else is needed in the program, just that?

That would be amazingly wonderful if that's the case.
0
dsavill
10/17/2004 1:46:00 AM
Yup...
Matt Brown
MetalReview.com - Metal music community and reviews
Haulix - Easy promotional media distribution for the music industry
0
mattb
10/17/2004 1:52:58 AM
When you say DLLs, I believe they are in the bin directory of your application..... So, if you change/delete any dll in that directory, the application is restarted. Maybe this is the problem.

>>>>>> Yep, I knew about that one. I'm not updating the web.config each time, just the aspx, ascx and DLL's. I'm using forms authentication. The session seems to get lost randomly, at any time, not necessarily immediately after I update files. <<<<<<<<
Rules at work:
1) Boss is always right
2) If Boss is wrong; refer rule #1
0
dotnetrook
10/17/2004 2:58:58 AM
Yeah, I'm aware that updating the DLL's restarts the application, and it does restart immediately after updating the DLL's...  But it continues to restart itself (so it seems) several minutes, hours or days later, for no apparent reason that I can see.  I did read an article about some funky setting in the machine.config file which I guess controls how frequently ASP decides to restart itself after changes are made.  It made it sound like there were some bugs related to when ASP flushes its memory, so maybe that's still the problem.  I think I'll try playing with that again.

To anyone that is having similar problems, I would recommend restarting the ASP worker process each time after updating any DLL's. That seemed to help a ton. I think it's w3wp.exe, at least on my system.
0
traxon
10/18/2004 3:18:26 PM

i've an other thread witch look like the same of your... but i'm just updating databases!!!!
are you sur your problem deals with those updates?
0
tomac
10/19/2004 7:42:21 AM
No, I have no idea what's causing it.  It might be related to the updates or it might not be; I just thought I'd mention it.  I'm guessing that it might have something to do with ASP running out of memory or something.  I haven't noticed anything obviously wrong when I check the number of processes running or amount of memory used.  

Is there an easy way I can monitor how much memory and cpu time ASP is using over time? I'd like to take a closer look at that but haven't tried it before.
Thanks.
0
traxonfxp
10/19/2004 11:57:38 PM
Another thing

when the session variable isn't set to something, I get a error page saying:
Object reference not set to an instance of an object
How do I avoid this when I need to check a session variable that may not have been set yet?
0
dsavill
10/20/2004 5:02:43 AM
i had a similiar problem with sessions getting lost for no reason. The fix for me was

in IIS I put my application pool in a session state fix, which helped with the untimely session time outs
0
afelicetti
10/25/2004 8:52:50 PM
What does putting my application pool in a session state fix mean? I am having similar problems - random session state resets.
0
jbmeeh
10/27/2004 5:06:00 PM

I've got the same problem too (Application_Start event keeps firing every few hours, HTTPContext is lost). If you could expand on what "put my application in a session state fix" that would be great.
Thanks,
Chiz.
0
ianmain
11/3/2004 10:49:37 PM

I have the same problem but with a few differences.  I have a long form to fill out on my website.  Sometimes sporadically the session gets dropped and can't write to the database because obviously the data isn't there.

The spin I have is that I am using a public hosting company not my own dedicated server so I don't have the control over the web server or the database as I would like.  I think what is happening is that I'm on a shared server and between me and everyone else making changes it causes it to recycle often.

My form spans 5 pages plus a review page.  My next alternative is write everything to a cookie after every page but then I have the problem of users who disable cookies.

Does anyone have any other suggestion for a work around??? please...

Thanks in advance,

John

 

0
jonven
6/2/2006 6:14:07 PM
Reply:

Similar Artilces:

Good news for those of you who get "Unable to make the session state request to the session state server." error..
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 accep...

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...

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 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...

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."   &...

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 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...

"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
 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...

doubt in application state and session state
Is it right, application state stores value for a web application, but session state stores value for a specific user over a website? Yes... but can I know the purpose of this specific question...This article has simple and effective instructionshttp://support.microsoft.com/kb/307598  Thanks and RegardsS.K.Vignesh----------------------Do remember to "Mark as answer" for this post or the post that helped you solve the issue  Ok, I did some reading on application state as I've not really used it but, in general you statement is correct.  Application State store...

What is application state dan session state?
Hello everybody,i want to ask what is application state and when we use it. Can you give me the example... I want to ask again, if i use session and many user visit my website the session for the users is different or same..?Thank you very much...   Hi,The best place to learn is the quickstartsUnderstanding Applications and State Regards  ASP.NET Hosting (HostingFest)...

Session state, app state or class?
    Greetings     I developing an application which will load a number of panels onto a page    The number of panels to display on the page will depend on data which was     stored in a sql db during setup phase    Which is the most effecient way to get that data?    1) run a class on the server which gets the data from the db and sends it to        the browser each time the page is displayed     2) run the class on the server on app start and then ...

Web resources about - Session state keeps getting lost it seems.... - asp.net.state-management

Barack Obama speech to joint session of Congress, February 2009 - Wikipedia, the free encyclopedia
Obama's first State of the Union Address was the 2010 State of the Union Address . The speech was delivered on the floor of the chamber of the ...

Wall St ends shortened session steady - Business Spectator
US markets lack direction in abbreviated post-Thanksgiving trading session.

NRL: Canberra Raiders head to Stromlo for intense running session to counter rule change
The Canberra Raiders are adapting to the NRL's reduction in interchanges and ensuring their front-rowers are fitter to play extra minutes next ...

Perth pub, nightclub opening hours to extend - Sunday Sessions, WA
AS THE east coast of Australia cracks down on late-night drinking, Western Australia is heading in the opposite direction.

Perth Sunday session trading hours extended
Perth pubs and nightclubs can now keep their doors open longer on Sundays under new liquor laws that come into effect this weekend. Perth pubs ...

Aaron Paul Hosts Binge Watchers Anonymous Session for T-Mobile
Every weekday, we bring you the Ad Age/iSpot Hot Spots, new and trending TV commercials tracked by iSpot.tv, a company that catalogs, tags and ...

S&P 500 ends flat in holiday-shortened session
The S&P 500 closed little changed on Friday, a fourth straight day of declines, amid weakness in energy and Walt Disney.

Should We Fear Peak Human?: Master Post for Uncharted 2015 Brad DeLong-Peter Leyden Session
**Jennie Eliot**: Your Uncharted Interview Video: To Brad, Peter.... >All links in one place: >* [Full video with highlights](http://reinven ...

Jeff Sessions: Supporting Citizenship for Illegals 'Should Be Disqualifying'
Jeff Sessions said supporting citizenship for illegals ought to be “disqualifying” for any candidate running to be the Republican nominee

TWIABP filmed a live session video for "I Can Be Afraid of Anything," add 2nd NYC show to tour
photo: TWIABP at LPR in August (more by Mimi Hong) The World Is A Beautiful Place & I Am No Longer Afraid To Die is on tour now supporting this ...

Resources last updated: 11/29/2015 2:38:05 AM