Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #81 (permalink)  
Old March 1st, 2005, 06:13 PM
Registered User
 
Join Date: Mar 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I experienced exactly the same problem as the original poster. Between one page and the next, everything in Session was disappearing and users were getting a brand new SessionID.

We're using IIS 6 under Win2k3, so we did what everyone suggested. We changed our computer name, ensured no AV activities were occurring, created a separate application pool with no recycling, etc... Nothing worked.

What finally ended up fixing the problem was identifying the real cause of the trouble: redirecting from a virtual directory to another (real) directory.

More specifically, we have a top-level virtual directory called "soc" that points to a folder buried pretty deep in our actual hierarchy. When a user goes types in "http://our.domain.com/soc/" they get a form to fill out. The form submits to the same page and basically stores everything to Session before redirecting them to "page 2".

But the redirect in our ASP code wasn't made to the file under the virtual directory, it was made to the real file name, the one buried deep in our folder hierarchy. Apparently, even though the virtual directory maps to the same place, redirecting from a virtual directory file to the real file URL starts a brand new Session, even though everything is running under the same application pool.

Weird, huh? Making the redirect URL point to the file under our virtual directory (and not the real address) somehow keeps the same Session. I hope this helps.

-Dan
Reply With Quote
  #82 (permalink)  
Old March 23rd, 2005, 08:52 PM
Registered User
 
Join Date: Mar 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi everybody,

I'm happy I found this topic. I don't think my problem is the same as yours, but it's closely related.
I'm developing classic ASP pages. Usually my "mainframe" is one .asp file with includes. All system variables are stored in session (in an array). My session timeout setting on the server (Win2003) is set to 300 minutes. If I log in and start editing a forum reply, let's say... for about 20 minutes, than after posting it, my session's totally gone: i'm on the front page, i'm logged out.

What can I do? It's annoying when forum messages are gone after a long editing period.



Reply With Quote
  #83 (permalink)  
Old March 24th, 2005, 06:16 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Where exactly did you set this session timeout setting?

Maybe your setting is overridden by a Virtual Directory located below the root of your site, or some page (like the global.asa or another page) is changing the timeout through code?

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #84 (permalink)  
Old April 15th, 2005, 02:51 PM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by peter_a
 Hi everybody,

I'm happy I found this topic. I don't think my problem is the same as yours, but it's closely related.
I'm developing classic ASP pages. Usually my "mainframe" is one .asp file with includes. All system variables are stored in session (in an array). My session timeout setting on the server (Win2003) is set to 300 minutes. If I log in and start editing a forum reply, let's say... for about 20 minutes, than after posting it, my session's totally gone: i'm on the front page, i'm logged out.

What can I do? It's annoying when forum messages are gone after a long editing period.



Reply With Quote
  #85 (permalink)  
Old July 28th, 2005, 09:04 AM
Registered User
 
Join Date: Jul 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Same issue here! I'm developing on my local machine (XP SP2) with ASP.NET and everything works fine. I'm uploading to a public development server (Win 2000, latest SP) and it works fine. When we move it to the QA machine (Win 2000, latest SP), all the session vars vanish with IE. I checked gatecrasher005's experience, and sure enough, Firefox behaves normally.

Reply With Quote
  #86 (permalink)  
Old January 7th, 2006, 01:24 AM
Registered User
 
Join Date: Jan 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Folks, though this thread is now several months old, in case anyone comes across it, I'd like to share what I discovered as the reason that sessions can disappear (or unexpected logouts occur) on .NET, particularly "randomly" or when moved to "a new box". Here's my blog entry explaining what I discovered:

http://bluedragon.blog-city.com/lost...ssionstate.htm

Reply With Quote
  #87 (permalink)  
Old February 15th, 2006, 07:16 AM
Registered User
 
Join Date: Feb 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have just come across this problem on our IIS6 server and we have tried everything mentioned above and have tried other forums but have yet managed to come up with a fix.

We have this working fine on our IIS5 and IIS5.1 (XP Pro) servers. The only difference is that we have the IIS6 is that the Locale Settings are in German.

I am just wondering if anyone has actually managed to get this working? Or has microsoft actually come up with a fix for it yet?

Reply With Quote
  #88 (permalink)  
Old February 24th, 2006, 07:10 AM
Registered User
 
Join Date: Feb 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think I found a solution.

I found what the problem was the enable rapid-fail protection within the DefaultAppPool was enabled to 5 failures than it would restart. This can be found under the Health tab.

I disabled this along with the Recycle worker processes and now it times out the session when is it supposed too (30 minutes).

Hope this helps.

Reply With Quote
  #89 (permalink)  
Old March 8th, 2006, 12:29 PM
jts jts is offline
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This thread was extremely useful. I was having a similar problem with straight ASP code. My sessions were getting reset randomnly. My solution, taken from several of the suggestions in the thread, was to:
1.) Create a new App Pool.
2.) I turned off the "Recycle Workers", "Enable Rapid Fire Protection", and set the webgarden to have only 1 process.
3.) Move your application to use that new pool.
4.) Restart IIS.

Seemed to have done the trick for me. Hope this helps someone else.

Reply With Quote
  #90 (permalink)  
Old April 19th, 2006, 09:58 AM
Registered User
 
Join Date: Apr 2006
Location: Hazlet, NJ, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well I was dealing with the same issue you all are having. My session variables would disappear. But it was really annoying because they would be there initially, then I would reload and they would be gone. Then I would reload again and they would be there. So this kept happening forever until they were finally gone.

My setup is Win2003 Server and IIS6 using an ASP.NET 2.0 app pool.

Aaaanyway... I used hsilived's solution of only recycling at a specified time during the day. Now it works. Go figure. I just want to say that this thread has been a great help, and I want to thank all that contributed (except for the off-topic folk who wasted my time).

Edit:
Hmm, scratch that. That solution stopped working. Now I've incorporated the rapid-fail solution and it seems to be working. Wow, I hate microsoft.

Edit2:
Nope, that doesn't work anymore now either. I give up...

Edit3:
Now I also incorporated the worker process fix. IIS defaults to 5 worker processes. I set it to 1 as someone mentioned and it's working (for the time being).
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Variables Randomly Disappeared Dmitriy .NET Framework 1.x 1 November 30th, 2006 01:24 AM
Session Variables in C# shikha09 C# 1 November 28th, 2006 10:38 AM
Session Variables Randomly Disappeared Dmitriy General .NET 0 November 20th, 2006 08:42 AM
Is it possible for me using session variables into see07 ASP.NET 1.x and 2.0 Application Design 4 March 9th, 2005 07:46 PM
session variables help face Classic ASP Databases 4 September 12th, 2003 03:57 PM



All times are GMT -4. The time now is 03:58 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.