473,387 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 2143
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*******@discussions.microsoft.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*******@discussions.microsoft.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"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
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*******@discussions.microsoft.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*******@discussions.microsoft.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*******@discussions.microsoft.com>
Sender: "Stephen" <an*******@discussions.microsoft.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+3SlisV7v+xbDzjg==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.dotnet.framework.aspnet
Path: cpmsftngxa07.phx.gbl
Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.framework.aspnet:198906
NNTP-Posting-Host: tk2msftngxa14.phx.gbl 10.40.1.166
X-Tomcat-NG: microsoft.public.dotnet.framework.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
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...
2
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...
4
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...
2
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...
9
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...
0
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...
0
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...
2
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...
5
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.