473,657 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Losing Session Variable

I have a .NET (1.1 framework) application that is losing a
session variable on only a few PC's. The main page is
loading up in a frame in a Portal application. On the
Page_Load it stores an object with the user id and
password into the session.

The web page includes a set of links. When the user
clicks on a link, another page within this application is
opened in a new window. On the Page_Load of this second
page, I am retrieving the user object from the Session and
it is returning a null value.

This is all happening within a few seconds, so it is not a
timeout issue. Any ideas?
Nov 18 '05 #1
4 2159
Frames... well its the holygrail and you are walking on a tight rope...

I think whats happening is that you are essentially starting up a new
session on the click... try dumping the SessionIDs....
My guess is they will be different... and since they are not in the same
session... you are getting null....

try placing the object in cache or passing it as query string params to the
newly opened page...

hope this helps

--
Regards,

HD

"Stephen" <an*******@disc ussions.microso ft.com> wrote in message
news:0b******** *************** *****@phx.gbl.. .
I have a .NET (1.1 framework) application that is losing a
session variable on only a few PC's. The main page is
loading up in a frame in a Portal application. On the
Page_Load it stores an object with the user id and
password into the session.

The web page includes a set of links. When the user
clicks on a link, another page within this application is
opened in a new window. On the Page_Load of this second
page, I am retrieving the user object from the Session and
it is returning a null value.

This is all happening within a few seconds, so it is not a
timeout issue. Any ideas?

Nov 18 '05 #2
Thanks for the suggestion. Any thoughts on why this would
only happen on a few PC's? They are running IE6,
including the 1100 PC's that do work.
-----Original Message-----
Frames... well its the holygrail and you are walking on a tight rope...
I think whats happening is that you are essentially starting up a newsession on the click... try dumping the SessionIDs....
My guess is they will be different... and since they are not in the samesession... you are getting null....

try placing the object in cache or passing it as query string params to thenewly opened page...

hope this helps

--
Regards,

HD

"Stephen" <an*******@disc ussions.microso ft.com> wrote in messagenews:0b******* *************** ******@phx.gbl. ..
I have a .NET (1.1 framework) application that is losing a session variable on only a few PC's. The main page is
loading up in a frame in a Portal application. On the
Page_Load it stores an object with the user id and
password into the session.

The web page includes a set of links. When the user
clicks on a link, another page within this application is opened in a new window. On the Page_Load of this second
page, I am retrieving the user object from the Session and it is returning a null value.

This is all happening within a few seconds, so it is not a timeout issue. Any ideas?

.

Nov 18 '05 #3
well first frames mean nothing to the server... its just child windows in
the browser and first request in the each frame starts a session by
itself....

as for why its not happening on other machines.... could have something to
do with session config in web.config file
by default .... session id is written in a cookie
<sessionState
mode="InProc"
stateConnection String="tcpip=1 27.0.0.1:42424"
sqlConnectionSt ring="data
source=127.0.0. 1;Trusted_Conne ction=yes"
cookieless="fal se"
timeout="20"
/>
if the client browser doesnt accept cookies... that would cause every
request from that machine to have a new session....
Think thats my understanding of it...

--
Regards,

HD

"Stephen" <an*******@disc ussions.microso ft.com> wrote in message
news:02******** *************** *****@phx.gbl.. .
Thanks for the suggestion. Any thoughts on why this would
only happen on a few PC's? They are running IE6,
including the 1100 PC's that do work.
-----Original Message-----
Frames... well its the holygrail and you are walking on a

tight rope...

I think whats happening is that you are essentially

starting up a new
session on the click... try dumping the SessionIDs....
My guess is they will be different... and since they are

not in the same
session... you are getting null....

try placing the object in cache or passing it as query

string params to the
newly opened page...

hope this helps

--
Regards,

HD

"Stephen" <an*******@disc ussions.microso ft.com> wrote in

message
news:0b******* *************** ******@phx.gbl. ..
I have a .NET (1.1 framework) application that is losing a session variable on only a few PC's. The main page is
loading up in a frame in a Portal application. On the
Page_Load it stores an object with the user id and
password into the session.

The web page includes a set of links. When the user
clicks on a link, another page within this application is opened in a new window. On the Page_Load of this second
page, I am retrieving the user object from the Session and it is returning a null value.

This is all happening within a few seconds, so it is not a timeout issue. Any ideas?

.

Nov 18 '05 #4

Add some lines in your code to check and print (or write to a log file) the
session ID when a user browses to the second page.

Compare that to the session id on the first page, and you should be able to
tell what's going on. If the ID's are different, then somehow you've
started a new session with the server. The reasons for this could be
security settings on the browsers. (Check Internet Options, and make sure
your Cookies are turned on, and aren't restricted)

If the ID's are the same, then you probably have a bug somewhere in your
code where you set and/or get the value from the session.

--------------------------------------------------------------------
This reply is provided AS IS, without warranty (express or implied).
--------------------
Content-Class: urn:content-classes:message
From: "Stephen" <an*******@disc ussions.microso ft.com>
Sender: "Stephen" <an*******@disc ussions.microso ft.com>
Subject: Losing Session Variable
Date: Tue, 30 Dec 2003 09:41:37 -0800
Lines: 14
Message-ID: <0b************ *************** *@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
thread-index: AcPO/CyOKlDCB4+3Slis V7v+xbDzjg==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
Path: cpmsftngxa07.ph x.gbl
Xref: cpmsftngxa07.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1989 06
NNTP-Posting-Host: tk2msftngxa14.p hx.gbl 10.40.1.166
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

I have a .NET (1.1 framework) application that is losing a
session variable on only a few PC's. The main page is
loading up in a frame in a Portal application. On the
Page_Load it stores an object with the user id and
password into the session.

The web page includes a set of links. When the user
clicks on a link, another page within this application is
opened in a new window. On the Page_Load of this second
page, I am retrieving the user object from the Session and
it is returning a null value.

This is all happening within a few seconds, so it is not a
timeout issue. Any ideas?


Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2777
by: Scott Lyon | last post by:
I'm maintaining (read: I didn't write it, nor do I have the time to spend to rewrite it) an application that is suddenly giving me grief. The reason I say suddenly, is because we're in the process of transitioning the server on which it runs from Microsoft Windows 2000 Server, to 2003 server (going from IIS 5 to IIS 6). This problem hasn't really occurred on the 2000 server machine, but it's happening MUCH more on the new 2003 box (not...
2
1804
by: James | last post by:
Session("UserName") is set when someone logs in. Get to a page that displays a record where you can type a comment. The form has an onSubmit event that calls a javascript function. That function sets a javascript variable called beenChecked = true and then calls a PopUp window to spell check the comment. When it's done spell checking, it calls the submit method on the form tag of the opening window. The method evaluates that it's...
4
2401
by: Keith-Earl | last post by:
I have been writing ASP.NET apps since the RTM build and have never seen this. I built a simple app that uses session variables on my DEV laptop. All runs well. I have a simple toggle routine that checks the status of a Session variable. I keep losing the value of the variable. When I trace the page it is there, but it is gone next postback. Also, I use three tier objects and store my DataManager object in a session variable. It is...
2
291
by: Frank Bishop | last post by:
Can someone tell me why I'm losing my session variable when using Response.Redirect? When I use the RedirectFromLoginPage method(currently remmed out below), my session variable works fine, but I'm trying this other way with Response.Redirect and it seems all my redirection works, but it loses the session variable when I hit the redirected pages. Help appreciated. Here is code: <code> <%@ Import Namespace="System.Data.OleDB" %> <%@...
9
2537
by: Adrian Parker | last post by:
We have a website that works everywhere but on a few PCs on this one site.. Asp.Net 1.1 Server = Windows 2003 Client = XP In the web.config we use - cookieless="false" in the browser settings they have "Always allow session cookies" set to true When the browser connects to the website the first page sets a session variable called "user_ref" to something and then calls another page. If on
0
978
by: Frank Bishop | last post by:
Can someone tell me why I'm losing my session variable when using Response.Redirect? When I use the RedirectFromLoginPage method(currently remmed out below), my session variable works fine, but I'm trying this other way with Response.Redirect and it seems all my redirection works, but it loses the session variable when I hit the redirected pages. Help appreciated. Thanks. Here is code: <code> <%@ Import Namespace="System.Data.OleDB" %>
0
1390
by: Jimmy Reds | last post by:
Hi, Sorry if this appears twice but I post through Google Groups and it had a funny 5 minutes and didn't appear to post this message the first time. I am setting session variables on a page then doing a header/location redirect to a second page however I am losing one of my session variables. Not all of them, just one.
2
1554
by: Jimmy Reds | last post by:
Hi, I am setting session variables on a page then doing a header/location redirect to a second page however I am losing one of my session variables. Not all of them, just one. Here are some details/comments: I am doing a session_start() on ALL of my pages, right at the top of each page
5
6129
by: chromis | last post by:
Hi there, I've recently been updating a site to use locking on application level variables, and I am trying to use a commonly used method which copies the application struct into the request scope. Application variables are then accessed in this manner Request.App.<Var>. To begin with I had a simple functioning login system inside a subdirectory named admin, this subdirectory had it's own application.cfm, I wasn't sure whether to duplicate...
0
8413
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7352
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.