469,610 Members | 1,554 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,610 developers. It's quick & easy.

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 1941
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by James | last post: by
4 posts views Thread by Keith-Earl | last post: by
2 posts views Thread by Frank Bishop | last post: by
9 posts views Thread by Adrian Parker | last post: by
reply views Thread by Frank Bishop | last post: by
2 posts views Thread by Jimmy Reds | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.