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
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 Display Modes
  #101 (permalink)  
Old January 19th, 2007, 03:07 PM
Registered User
 
Join Date: Jan 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Regarding this feature where .NET watches a directory for changes and restarts, is there some way of disabling it? I have a folder that contains changing items and I want to exclude this folder from forcing the site to reload. I have tried moving the folder around but since it contains DLLs used by the site it seems that it gets watched regardless of where I put it. There must be SOME way of configuring the service to ignore a folder
Reply With Quote
  #102 (permalink)  
Old January 22nd, 2007, 03:43 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

This has all been very interesting and illuminating. I now have a clearer understanding of features of IIS.

But my problem appears to be an animal of a different stripe. When one of my users loses his credentials being held in the Session, all users lose their credentials and are presented the login page instead of the requested page.

Now, each person’s Session is actually an element in an object that holds all the “Sessions.” (A Dictionary object I believe.) Since all Sessions evaporate at the same time, I am presuming this central object is being reset, or abandoned and recreated.

If anyone has any insight on what mechanism might be at play here, I’d be really happy to hear it.
Reply With Quote
  #103 (permalink)  
Old January 22nd, 2007, 04:31 PM
Imar's Avatar
Wrox Author
Points: 71,804, Level: 100
Points: 71,804, Level: 100 Points: 71,804, Level: 100 Points: 71,804, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,044
Thanks: 80
Thanked 1,580 Times in 1,557 Posts
Default

Hi Brian,

Isn't this what most of the posters had problems with? When the IIS process is recycled, or web.config is touched, the *whole* session state goes down.

Did any of the situations apply to you? That is, do you have application pools set to recycle automatically at a certain interval for example?

Take a look here: http://blogs.msdn.com/david.wang/arc...e_on_IIS6.aspx for some more background.

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #104 (permalink)  
Old October 17th, 2008, 11:38 PM
Registered User
 
Join Date: Oct 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Got the same problem: Session vars disappear!

Using trace="on", could see session vars on page load but on post back all session vars gone! Didn't show up until switched from asp.net 1.x to 2.0

Took awhile but I did find the cause. Not in the vb source code...it's in one of the asp:image... tags! Two ways to fix or work-around:

1) Remove or comment out asp:image tag
   (just ones with missing imageURL should do)
2) Add imageURL="valid link" to asp:image tags (if missing)

To test, deleted almost all code in the code behind. Except for setting about 5 session vars on page load and one in post back.
I didn't try imageURL with an invalid link to see if that blows-up all the session vars too, geez, I hope not.

In original asp.net 1.x version the imageURL fragment was set in code. At design time, the imageURL was left blank. This didn't affect the session vars as it seems to do now under asp.net 2.0

<!--
If I may politically digress, hasn't someone read you the book 'The Earth is Flat'...Session Vars CAN'T DISAPPEAR...you're wrong!!!!
-->

I've noticed this is one of several problems that seem to have no solution...;)

Reply With Quote
  #105 (permalink)  
Old October 20th, 2008, 05:38 PM
Registered User
 
Join Date: Oct 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

On further review, there seems to be more than one issue that can cause disappearing session vars.

Older documents document, undocumented behavior of ReadOnly session vars: "If you attempt to write to a read-only session variable, no exception is thrown but a new session ID is generated...can create subtle bugs in your code...check the IsReadOnly property before assigning..."

<%@ Page EnableSessionState="ReadOnly %>

On hosted servers with garderns, farms and proprietary performance enhancers it may not be impossible to track session var behavior but software source generation performance can be severely reduced
Reply With Quote
  #106 (permalink)  
Old June 8th, 2010, 11:45 AM
Registered User
 
Join Date: Jun 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Friends, please check how many working process has IIS configured. Make sure it is set to 1. I realised that if you has this value set to 2 or more, session variables get lost for some reason. I think you need more than one processor in your server if you plan raising the amound of working processes.
Reply With Quote
  #107 (permalink)  
Old July 26th, 2012, 03:16 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Mr_Tom View Post
I had to reply here... I think I have found a solution to the random loss of Session Variables issue on IIS6.

Here is what we experienced:
- Session variables seemed to just disappear for no apparent reason
- not reproducible on demand - erratic, sometimes happens every couple of seconds. sometimes it's fine for minutes.
- We have seen the session variables disappear for one page in the site and then re-appear for a different page (or even the same page) later on, not actually having lost the variable for good.
- we actually run those sites load-balanced and it only happened on one of the servers in the webfarm.

[u]Our Solution</u>
For some strange reason we had a non-default setting in the Application Pools Properties. The webgarden was configured to use a maximum of 2 worker processes. With this setting we had the server randomly using process 1 or 2... causing this erratic behavior.
[u]To fix this:</u>
- open the IIS management console
- get properties on: "Application Pools"
- tab to: "Performance"
- find the setting under "Web garden" and decrease the "Maximum Number of Worker Processes" to "1"
- do an IISReset and test your application

This worked for us and saved me a lot of time, as I was just about to re-build the server (I had all my hair pulled out already :(

Good luck to all!

Thomas
Thank you soooooooooooooooooo much! I was on the verge of tears here. Been fighting with the server for days, with a ton of users cursing up to my great-great-grandmother, by e-mail, with copy to the boss (nice co-workers I got, huh?!). And I was about to make a new server, but there is no need now.
Reply With Quote
Reply


Thread Tools
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 04:57 PM



All times are GMT -4. The time now is 10:32 PM.


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