Session variables being lost

Hi all,

Has anyone ever heard of session variables just disappearing (equal to Nothing) like they'd never been defined?

I just did my first ASP.Net/VB project, a small app on my company's intranet site.  It works great for more than 100 users, but when you get to the app on one lady's laptop (regardless of who's logged onto the laptop) it fails with a NullReferenceException.  It turns out that all of the Session("variables") = Nothing... they're being lost between page displays.  The session vars are a string, an integer, a datetime, and a small (600-char) dataset, and they're all Nothing.  So when the code tries to use the vars, I get a NullReferenceException for the dataset object, or a nonexistent string being trying to be passed as an argument into a stored procedure.  My code is converting the session vars to the appropriate type before use:

  Session("Login") = UserLogin 'a string
  '   to retrieve it:
  UserLogin = CStr(Session("Login"))

  Session("dsDestination") = dsDestination  'a dataset
  '   to retrieve it:
  Dim dsDestination As DataSet = CType(Session("dsDestination"), DataSet)

After retrieving, the vars are Nothing.

What I've checked:
- It fails for me, too, when I plug my desktop's network cable into the lady's laptop, and log on as either myself and the user's login.  I was switching the network cable back and forth about 6-8 times, and my desktop always worked, and the laptop always failed.
- We only have one web server, not a server farm.
- The laptop's internet and intranet setting's from Control Panel / Internet Options / Security tab are identical to my PC's, which works fine.
- Another laptop purchased at the same time works fine.
- apparently not a permissions issue... our Network Admin was using the app from his XP desktop, but when that machine was tied up with a download and he got to the internet from a Windows Server 2003 box, he got the error... that's the only other user to have encountered this.

I'm not using cookies or application-level vars in this app anywhere.

In web.config, the "sessionState" items are:
  stateConnectionString="tcpip= etc
  sqlConnectionString="data source=;Trusted_Connection=yes"
It's just taking a very short time to bring up each page display, nothing like 4 or 5 seconds, much less 20.  The app isn't high-traffic; each of the 100 users probably goes to it for a few minutes, once every day or two.

I modified the program to reextract the dataset if it was Nothing, but then the program ran into the next session variable being Nothing a couple of steps down the road.  I realize that I could store the info in a cookie, but since this isn't a vital app that I have to immediately fix, and since I'd like to know for future reference how to avoid or fix this, I haven't made that change yet.

If anyone has any ideas, I'd appreciate it.

Thanks... LenexaKS

9/15/2006 1:12:18 PM 93655 articles. 6 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 5

since cookieless ='false' in your web.config, it still uses cookies to store session id.

pls chk if the laptop has cookies enabled.

if it is already enabled try this

also check if  check for newer versions of the pages everytime is ie settings

Sundara Prabu .T
.Net 2.0 MCTS, MCPD WebApps, WinApps, Enterprise Apps.
9/19/2006 10:55:22 AM

Hi Sundara,

Cookies are enabled.  Sorry for my ignorance, or maybe I'm just missing it, but I can't find a setting that looks like "check for newer versions of the pages everytime" in the IE settings... could you tell me where to look for this?


9/25/2006 12:55:12 PM


look for tools internet options - settings- every visit to the page

Sundara Prabu .T
.Net 2.0 MCTS, MCPD WebApps, WinApps, Enterprise Apps.
9/29/2006 7:17:07 AM
A Help Desk guy figured it out in about 3 minutes... the PC had "Integrity Desktop" installed.  ("Based on ZoneAlarm, the world's most trusted personal firewall, Integrity Desktop delivers preemptive protection against the latest worms, viruses, spyware, and hacker attacks.")  This product has caused us a variety of minor web-related glitches in the past.  A developer had told me to have the user check whether "ZoneAlarm" was installed, but in Add/Remove Programs it was called "Integrity Desktop".  Worked great after removing it and rebooting.
Thanks to all who responded...
10/13/2006 7:16:14 PM

Similar Artilces:

session variables in javascript on a web form
Hi All, I have master page on which I have written a javascript which open ups a new window when user clicks on menu item placed on the left side of master page. The javascript follows  function OpenWind()       {         <% if( HttpContext.Current.Session["Id"]==null) { %>                alert('Session Expired! Redirecting to login page!');           &nb...

Implementing .Net Form into an web form, can this be done
I am new here, but have been searching for a while, and may not have the correct lingo to find what I am looking for.  I am tasked with implementing a .exe application that was writen vb6 then converted to .net into a new website my team is developing. The idea is to put each of the 3 different forms in this .exe application of 3 different .aspx pages. I have attempted multiple things to get this into the page and even started to just rewrite it as an web form, but even then I can't reuse any of the code since the System.Web.UI.Page doesn't inherit the sa...

Session variable between web forms and Data Access Layer
I am using ASP.NET 2.0 with c#. I am trying to declare a global session object that will be used in both c# Class files (DAl) and my web forms (Presentation Tier). Now my session object is Session["Bookid"].  The value stored in this session object is the value from a selected item in my dropdown control. That works fine. But I want this Session object to be used in a (DAL) but the value is null.  Here is exactly what i am trying to do. 1). Select item from dropdown control (from Web form)2). Assign the selected item to Session["Bookid"]3). Access that Session ...

Web form session lost
G'day all, I am using VStudio 2003 to develop a commerical website that allows user to modify database records. For this example to edit customer profile using session assignment (eg session("customerid")=strCustomerID)  . Developed from my laptop and uploaded to the server and tested it from my IE browser at home seems fine and all. but when I logged in from another remote area that is from my work PC using I.E browser the session key seems to be lost (ie. when click on a customer from a list, and redirect to a customer page which shows all the details). The value fields are blank, ...

Session State Is Lost in Mobile Web Form Applications During Development
Inner Exception: System.Exception: 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. how to handle this situation in mobile web form I need you can try to delete those cookie.... Anyway where u access from???...

Acessing variables, objects and functions from javascript to VB .NET Web Forms
I have included some javascript files in my application. I want to access the variables, objects and functions of Javascript to the VB.NET Web Forms, which means that I want to transfer the methods from Javascript to the code-behind in a web form. How do I do this? Can anybody help me with some sample codes...thanks in advance . you can't pass javascript variables (client side) to code-behind (server side). you can however put your variables into hidden input fields then access those input fields from code-behind. or use ajax I think the only way to do this is...

Acessing variables,arrays, objects and functions from javascript to VB .NET Web Forms
I have a textbox where user can put data.I store data into an array .I did this with java i want to acess the array from the Codebehind  in web is the codefunction MakeArray( n ) { if( n <= 0 ) { this.length = 0; return this; } this.length = n; for( var i = 1; i <= n; i++ ) { this[ i ] = 0; } return this; } var Form1 = new MakeArray( 25 ); var index = 0; var cmmnd = 1; function f_store( sTR ) { var i; if( index >= Form1.length ) { for( i = 1; i < Form1.length; i++ ) Form1[i-1] = Form1; index = Form1.length - 1; } Form1[ index ] = cmmnd + ":" + sT...

Is "Session" the best solution for transfering variables between "Web Forms"??
Hi all; I am using an ASP.NET Web Application (with VB.NET)... and this App used to manage customers' requests.. so, ther user will handel customer#1 data for a while, then he (the user) will handle the data of customer#2. and so on.. And I need to transfer some variables value from one page (Web Form) to onother pages (Web Forms), Is the "Session" variable the BEST solution? and do you recommend me to increase its live to 60 mins or more. (In case the user need approx. 1 hour to handle customer#1 data!!)?? Example of values I want to transfer: CustomerID, RequestNo, Co...

windows forms in vb .net into web forms
we are creating a database driven website as part of our project. currently we have forms connecting to the database created in visual basic. these windows forms we need to convert into web forms which are asp .net compatible. can u give me an answer or show me a way. Hi, because of the difference in nature between web and win applications you'll need to reimplement at least the UI part. If you have a multitiered application in which the busines logic and data access are in different parts/assemblies you can reuse them. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Wor...

Web Service, Web Forms shared session
How could I share session between Web Service and Web Forms (they are in the same project). There is no problem when I refer to session in only one of them. But when I declare session value in one of them - second doesn't see it (== null).I put session ID in CookieContainer for Web Service, but I want to pass session values farther - to *.aspx sites of this project. Hi,You can't share session directly withing different projects of solution.One way of solution is use of StateServer mode of session.Thanks. Shah Dharnendra GSr.Analyst Programmer,GTL-Ahmedabad...

.Net Web Form & Web Service Deployment
Hi all I have written some test web services and some web form applications and deployed them to my IIS. That's fine but I now want to deploy them to my real IIS server. I have created an msi for each but the problem is I seem to only be able to deploy to the default web site. Our default web site is turned off and instead we use several other sites. Does anybody happen to if Powerbuilder 11 supports non default web sites? If not do I need to hack the msi and if so can anybody suggest a suitable tool. I have Orca but it's not very friendly. Unless of course I knew exactly w...

Web Part, Web Request, and HTML form Variables
I would like to build a web portal to display existing standalone web sites in separate web parts.  I was thinking I would need to use an IFRAME in a web part or have the web part do a web request and display the web response.  I would like to be able to monitor the http traffic between the web part and the existing web sites server so that I can perform additional processing on my server. Is there a way that I can capture (read only) the form variables/ hyperlink address when a user clicks a form submit button or hyper link in a web part that has an IFRAME? What if I used the w...

How to Make Web Forms from other Web Forms
In putting together an ASP.NET application for a biz application, we have come to the point where there are three different types of basic forms which have, for the most part, been perfected. Now its is a matter of cloning those forms for various uses and modifying or adding code to suit the particular need. Copy and paste works OK, but there is a lot of changing of certain words, etc. Is there a way in ASP.NET to take these basic forms, turn them into classes or templates, create forms from them, then add or overwrite code? ? (Anybody who is a Vis Fox Pro programmer would know imme...

Web forms and mobile web forms
Hey everyone, I am looking to develope a web site that depending on the device connecting to it, it will display a certain page. In this case im looking to create a web and wap version of the same project. I have the Web forms version finished using ASP.NET and C# and I am wondering how to create the mobile web form and incorporate it in the project. In the project folder, can I just add a mobile web??? But what about displaying device specific pages?? Cheers -Dudach Yes, you can add mobile web forms and controls to your Web Application project. No problem. For device/br...

When does Session.Abandon remove session variables (.NET 1.1)?
I have a logout function which includes session.abandon. This also (correctly) removes any session variables I've created if I look at them on the next page load. However, if I examine these variables immediately after the session.abandon call, they still exist with their current values. Where in the page life cycle does session.abandon actually remove these variables? Thanks in advance.  -- ZLA  After you have called Abandon() method, current session becomes invalid, but new session will be created on the next request. If you need to remove all values from session coll...

Web resources about - Session variables being lost -

Variable - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Westpac interest rate rise is one of many variable loan rate rises
WESTPAC is not alone in hitting its owner-occupier customers with a surprise interest rate rise, as dozens of other variable rate home loans ...

Airbnb upgrades variable pricing tool for hosts
Online home rental group Airbnb is rolling out an upgraded variable pricing tool that automatically raises or cuts room rates based on supply ...

Commonwealth Bank raises variable home loan rates
Home owners' mortgage costs are set to rise by hundreds of dollars a year, after the Commonwealth Bank became the latest bank to hike interest ...

CBA lifts variable home loan rates to offset costs associated with stricter capital requirements
The Commonwealth Bank to lift its home loan interest rates independently of the Reserve Bank to partially offset costs associated with stricter ...

Washington Square Signs Spielbergs, Choi Joins Variable and More
... films and an episode of the HBO comedy series "Girls," on which he plays the role of Ray Ploshansky. New York-based creative collective Variable ...

YouTube v10.32 Tweaks Some Interface Elements And Includes Hints About Virtual Reality Content And Variable ...
Forget Update Wednesday! Monday is the new big day. Not only were we treated to the latest M preview release and the official Marshmallow name, ...

"You have to ignore many variables to think women are paid less than men. California is happy to try." ...
Writes Sarah Ketterer in The Wall Street Journal in "The ‘Wage Gap’ Myth That Won’t Die" (which you can get to without subscribing if you Google ...

Cisco Debuts Open Pay Variable Pricing, Updates CCRE
Cisco Debuts Open Pay Variable Pricing, Updates CCRE Channel Partners Kris Snow, president of Cisco Capital, says the company's new Open Pay ...

Expert Reveals the Latest Variable Capacity Technology
Learn about gForce Ultra CRAC equipment, the latest variable capacity technology to lower energy usage and increase reliability.

Resources last updated: 12/8/2015 8:31:18 PM