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
  #41 (permalink)  
Old September 20th, 2004, 02:55 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm having the same problem with session variables disappearing (getting back to the original topic), and just thought I'd throw my 2 cents in. My Google searching has found a multitude of other people having the same problem, and it seems to be independent of wether the variables are stored in proc or out of proc.

For me not everyone looses their session variables at the same time. Someone's session will disappear while the other 50 people working on the same server will not experience any problems.

I've also had the session variables disappear mid page. E.g. I check to see that Session["UserName"] isn't blank at the top of every page, but there have been times when the program ran past the check, but then failed half way down the page.

I'm convinced this is a bug in IIS and there is no known fix. So I'll just switch to using cookies.

Reply With Quote
  #42 (permalink)  
Old September 20th, 2004, 03:05 PM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default

To recap, the solution I developed to work around this bug was to use encrypted querystrings. I was not passing extremely large values and this also avoided the issue where people refused to accept cookies. This worked well for my purpose (and better than session variables, obviously) by getting the data across in a tamper identifiable state, but might not work for others depending on need.

I hope MS figures this out soon and fixes it as I'm sure another project will eventually arise in which this work around will not work.
Reply With Quote
  #43 (permalink)  
Old October 14th, 2004, 09:20 AM
Registered User
 
Join Date: Oct 2004
Location: London, , United Kingdom.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi All

I have had this with asp 3.0 and IIS 6. We kept loosing the session variables. The company we use to host an asp application increased the recycle rate so it did not occurr as often and this solved the problem. The recycle was causing the session variables to be reset I guess.

We initially used just access as we only had a small number of users who were rarely concurrent.

Cheers Celephant
Reply With Quote
  #44 (permalink)  
Old October 20th, 2004, 02:47 PM
Registered User
 
Join Date: Oct 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi all,

I encountered a similar problem before and it turned out to be the oddest thing. Apparently IIS drops the entire session if more than 20 cookies are created on the client. It's a strange bug and took me quite a while to figure out but is worth investigating for those users that are experiencing these random session resets.
Reply With Quote
  #45 (permalink)  
Old October 25th, 2004, 03:02 PM
Registered User
 
Join Date: Oct 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for this posting. It saved me hours of time. I had the same issue you reported. I cut down my cookies to below 20 and I haven't seen them drop since.

Bill
Reply With Quote
  #46 (permalink)  
Old November 9th, 2004, 09:22 AM
Registered User
 
Join Date: Nov 2004
Location: , , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This may be a dumb question, but how do i reduce the number of cookies?

Reply With Quote
  #47 (permalink)  
Old November 9th, 2004, 09:30 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Reduce the number of what cookies? The only cookies that you have control over are those you write.
Reply With Quote
  #48 (permalink)  
Old November 9th, 2004, 11:26 AM
Registered User
 
Join Date: Nov 2004
Location: , , United Kingdom.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Good point. i said that it was probably a dumb question, but hey, didn't someone once say that there is no such thing as a stupid question, just stupid people who are afraid to ask!

I thought that maybe there was some sort of property being referred to which limits the cookies in IIS that i didn't know about.

Reply With Quote
  #49 (permalink)  
Old November 9th, 2004, 04:19 PM
Registered User
 
Join Date: Nov 2004
Location: Guildford, Surrey, United Kingdom.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I also have problems with session variables disappearing. I am using VS.net but I have a hunch that it is the configuration of the web server that makes the difference. My code makes heavy use of session variables - including objects and arrays - and it is as if some web servers just can't manage. My own local instance of IIS intermittently but frequently just 'forgets' certain objects. Sometimes you can reproduce the fault .... but then I send it to a fellow developer and it does not happen for them, even with the same code. I would love to know if you can 'tweak' the settings in IIS
so that you can grab less or more of the web server memory. If I adjusted this up and down and then showed it affected the severity of the problem then I could prove my hunch. However I don't seem to be able to give the ASP client more than 'low' priority in the MMC. Any ideas gratefully accepted
Reply With Quote
  #50 (permalink)  
Old December 1st, 2004, 04:49 AM
Registered User
 
Join Date: Dec 2004
Location: Sofiq, Sofiq Grad, Bulgaria.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by X-Ken
 I had same problem as well before. The session was gone either after i open a connection to db or close it (i forgot which one).
then my friend moved my access db from bin directory to the root directory and miraculously it works!

Hope it helps
Quote:
quote:Originally posted by Imar
 Hmmm, that seems reasonable to me. I think the .NET Framework monitors the Bin folder for changes. As soon as you change, say, the Web.Config file, the changes are picked up immediately because someone is watching that file, and restarts ASP when the file has changed.

I always thought it was monitoring individual files, but come to think of it, it makes a lot more sense if it is monitoring the entire folder. Since accessing the database will either change the database file, or generate a .lck inside that folder, a change is noticed, and the ASP.NET application is silently restarted.

I never ran into this because I do not store my database in the Bin folder, but in a /Databases folder instead, but storing it in the Bin folder can certainly cause session variables to get lost. Interesting....

Imar
Just want to mention that this was the problem with me. I got some log files created in bin dir, and when i moved them out the problem was solved! thank u dudes - i spent 3 days looking everywhere and trying a lots of things before i come to this forum :-) u help me a lot.
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 06:37 PM.


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