473,673 Members | 2,688 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 2160
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
2778
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
2539
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
1392
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
1556
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
6132
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
8509
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...
0
8429
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8953
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8855
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8704
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
4254
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...
1
2853
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2104
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.