473,385 Members | 1,402 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,385 software developers and data experts.

Postback lossing Session values?

Hi Everyone,

I have been fighting a problem for a while and I wonder if someone out
there can help.
This problem has been presented in a number of news postings
previously but I am yet to see a response with a suitable resolution.
So here goes ...

We have a web site which stores an instance of a class into a Session,
which is used in a number of pages. The code looks something like:

Session["CurrentMyClass"] = new MyClass();

This bit of code is executed in (lets say) a login page.

Now in a page later on, I try to do something like:

MyClass localClass = (MyClass)Session["CurrentMyClass"];

and I get the object I put into the session.

My problem is that a large number of customers are experiencing a
problem where they work through the web-site, and at a certain point
the above code line returns null.

* Now this behaviour only seems to occur after they have done a
postback *

Now just to eliminate the first round of expected questions and
answers:

- I am using v1.1 of the framework
- The customers have allowed all cookies including session cookies
within thier browsers
- We do not have a virus scanner or anything else that should be
restarting the application. (As an aside, I have walked through the
web-site with a customer while he was on the phone, and we went
through each of the pages together - me on my browser and him on his -
he hit this problem and I did not).
- The session timeouts are 20 minutes. In the walkthrough mentioned
with the customer earlier, again I didn't hit a problem and we started
a new browser session at the same time.

My frustration is that we cannot reproduce the problem in-house - but
we know customers are hitting this problem as we have embedded tracing
within the pages!

My analysis has lead me to a couple of theories, but my ignorance has
not allowed me to judge them appropriately:

- Could there be a JavaScript configuration issue with client
browsers?
- Could it be a connection speed issue? Most of our customers are on
dial-ups and we are on a fast link to our web-sites.
- Could it be a firewall configuration problem from the client end?
- I am not populating Session["CurrentMyClass"] in Session_Start(). I
am not sure moving this line there will help because in reality I need
to do:

if (something)
Session["CurrentMyClass"] = new MySubClass1();
else
Session["CurrentMyClass"] = new MySubClass2();

where MySubClass1 and MySubClass2 subclass from MyClass, and I only
does this after they have logged in.

- On postback, the Session.IsNewSession is false
- The pages belong to the same web-application
- I don't think I can use an ASPState service or SQL to solve this
problem as MySubClass1 and MySubClass2 are not serializable.
- Myself and a number of my colleagues have walked through the code
independantly to look for logic errors and we are yet to find one (in
this area at least :)

I am guessing this is a client-side configuration issue as this
problem will either always occur for a customer or never occur.

We have moved the web site hosting during this process and this
problem was occuring before and after the move.

Any help would be greatly appriciated. If you need any more info,
please let me know.

Thanks in advance for your consideration of this problem.

Mark Rodrigues
Nov 17 '05 #1
5 2578
There are additional kb articles on this.

1. http://support.microsoft.com/default...;en-us;Q316148

2. http://support.microsoft.com/default...;en-us;Q323752

3. http://support.microsoft.com/default...;en-us;Q324772

Our problem couldnt be solved by above, as there was antivirus running on
the webserver. Sol Out proc Sql server killed the problem. That i sould say
is the best bet.
"Mark Rodrigues" <ma************@tradergroup.com.au> wrote in message
news:9e**************************@posting.google.c om...
Hi Everyone,

I have been fighting a problem for a while and I wonder if someone out
there can help.
This problem has been presented in a number of news postings
previously but I am yet to see a response with a suitable resolution.
So here goes ...

We have a web site which stores an instance of a class into a Session,
which is used in a number of pages. The code looks something like:

Session["CurrentMyClass"] = new MyClass();

This bit of code is executed in (lets say) a login page.

Now in a page later on, I try to do something like:

MyClass localClass = (MyClass)Session["CurrentMyClass"];

and I get the object I put into the session.

My problem is that a large number of customers are experiencing a
problem where they work through the web-site, and at a certain point
the above code line returns null.

* Now this behaviour only seems to occur after they have done a
postback *

Now just to eliminate the first round of expected questions and
answers:

- I am using v1.1 of the framework
- The customers have allowed all cookies including session cookies
within thier browsers
- We do not have a virus scanner or anything else that should be
restarting the application. (As an aside, I have walked through the
web-site with a customer while he was on the phone, and we went
through each of the pages together - me on my browser and him on his -
he hit this problem and I did not).
- The session timeouts are 20 minutes. In the walkthrough mentioned
with the customer earlier, again I didn't hit a problem and we started
a new browser session at the same time.

My frustration is that we cannot reproduce the problem in-house - but
we know customers are hitting this problem as we have embedded tracing
within the pages!

My analysis has lead me to a couple of theories, but my ignorance has
not allowed me to judge them appropriately:

- Could there be a JavaScript configuration issue with client
browsers?
- Could it be a connection speed issue? Most of our customers are on
dial-ups and we are on a fast link to our web-sites.
- Could it be a firewall configuration problem from the client end?
- I am not populating Session["CurrentMyClass"] in Session_Start(). I
am not sure moving this line there will help because in reality I need
to do:

if (something)
Session["CurrentMyClass"] = new MySubClass1();
else
Session["CurrentMyClass"] = new MySubClass2();

where MySubClass1 and MySubClass2 subclass from MyClass, and I only
does this after they have logged in.

- On postback, the Session.IsNewSession is false
- The pages belong to the same web-application
- I don't think I can use an ASPState service or SQL to solve this
problem as MySubClass1 and MySubClass2 are not serializable.
- Myself and a number of my colleagues have walked through the code
independantly to look for logic errors and we are yet to find one (in
this area at least :)

I am guessing this is a client-side configuration issue as this
problem will either always occur for a customer or never occur.

We have moved the web site hosting during this process and this
problem was occuring before and after the move.

Any help would be greatly appriciated. If you need any more info,
please let me know.

Thanks in advance for your consideration of this problem.

Mark Rodrigues

Nov 17 '05 #2
There are additional kb articles on this.

1. http://support.microsoft.com/default...;en-us;Q316148

2. http://support.microsoft.com/default...;en-us;Q323752

3. http://support.microsoft.com/default...;en-us;Q324772

Our problem couldnt be solved by above, as there was antivirus running on
the webserver. Sol Out proc Sql server killed the problem. That i sould say
is the best bet.
"Mark Rodrigues" <ma************@tradergroup.com.au> wrote in message
news:9e**************************@posting.google.c om...
Hi Everyone,

I have been fighting a problem for a while and I wonder if someone out
there can help.
This problem has been presented in a number of news postings
previously but I am yet to see a response with a suitable resolution.
So here goes ...

We have a web site which stores an instance of a class into a Session,
which is used in a number of pages. The code looks something like:

Session["CurrentMyClass"] = new MyClass();

This bit of code is executed in (lets say) a login page.

Now in a page later on, I try to do something like:

MyClass localClass = (MyClass)Session["CurrentMyClass"];

and I get the object I put into the session.

My problem is that a large number of customers are experiencing a
problem where they work through the web-site, and at a certain point
the above code line returns null.

* Now this behaviour only seems to occur after they have done a
postback *

Now just to eliminate the first round of expected questions and
answers:

- I am using v1.1 of the framework
- The customers have allowed all cookies including session cookies
within thier browsers
- We do not have a virus scanner or anything else that should be
restarting the application. (As an aside, I have walked through the
web-site with a customer while he was on the phone, and we went
through each of the pages together - me on my browser and him on his -
he hit this problem and I did not).
- The session timeouts are 20 minutes. In the walkthrough mentioned
with the customer earlier, again I didn't hit a problem and we started
a new browser session at the same time.

My frustration is that we cannot reproduce the problem in-house - but
we know customers are hitting this problem as we have embedded tracing
within the pages!

My analysis has lead me to a couple of theories, but my ignorance has
not allowed me to judge them appropriately:

- Could there be a JavaScript configuration issue with client
browsers?
- Could it be a connection speed issue? Most of our customers are on
dial-ups and we are on a fast link to our web-sites.
- Could it be a firewall configuration problem from the client end?
- I am not populating Session["CurrentMyClass"] in Session_Start(). I
am not sure moving this line there will help because in reality I need
to do:

if (something)
Session["CurrentMyClass"] = new MySubClass1();
else
Session["CurrentMyClass"] = new MySubClass2();

where MySubClass1 and MySubClass2 subclass from MyClass, and I only
does this after they have logged in.

- On postback, the Session.IsNewSession is false
- The pages belong to the same web-application
- I don't think I can use an ASPState service or SQL to solve this
problem as MySubClass1 and MySubClass2 are not serializable.
- Myself and a number of my colleagues have walked through the code
independantly to look for logic errors and we are yet to find one (in
this area at least :)

I am guessing this is a client-side configuration issue as this
problem will either always occur for a customer or never occur.

We have moved the web site hosting during this process and this
problem was occuring before and after the move.

Any help would be greatly appriciated. If you need any more info,
please let me know.

Thanks in advance for your consideration of this problem.

Mark Rodrigues

Nov 17 '05 #3
Thanks a lot Rajesh for responding (and looking up the MS KB).

Unfortunately, non of these problems describe scenarios I am
encountering.

If someone said there was a problem with the framework and I had to
work-around this problem by using an out of proc server solution then
I would be happy to do so.

I don't like the idea of doing so if I am theoretically doing
everything right and there isn't a problem with the framework. Making
a change may just be hiding an underlying problem in my code that I
haven't found yet and moving to an out of proc server just hides it
.... for a little while ...

If the problem is a client-side one, then I don't suspect moving to an
out of proc model will help me anyway.

Does anyone else out there have any ideas or experiences with a
similar scenario?

Thanks again.

Mark
Nov 17 '05 #4
Thanks a lot Rajesh for responding (and looking up the MS KB).

Unfortunately, non of these problems describe scenarios I am
encountering.

If someone said there was a problem with the framework and I had to
work-around this problem by using an out of proc server solution then
I would be happy to do so.

I don't like the idea of doing so if I am theoretically doing
everything right and there isn't a problem with the framework. Making
a change may just be hiding an underlying problem in my code that I
haven't found yet and moving to an out of proc server just hides it
.... for a little while ...

If the problem is a client-side one, then I don't suspect moving to an
out of proc model will help me anyway.

Does anyone else out there have any ideas or experiences with a
similar scenario?

Thanks again.

Mark
Nov 17 '05 #5
Mark,

I have been experiencing the same (dare I say it...) bug in ASP.NET
(.NET 2003). In my case, I have code in the page load event of every
page that checks for the existence of certain session variables;
specifically, userid values that I want persisted, but hidden from
prying eyes.

And sometimes they just go away!

I have had this happen on our remote site and had it happen on our
localhost, but it is very sporadic and I know of no way to reproduce
it.

I am extremely frustrated with this issue, especially knowing that I
look stupid in the eyes of my boss and our clients. And without being
able to reproduce it at will, Microsoft will probably ignore it and
just let our web apps continue to fail.

Sigh....
Paul Drust
pa***@maronsoftware.com
Nov 17 '05 #6

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

Similar topics

1
by: Rhys | last post by:
I have a page which has an IFrame on it. The src of the IFrame is a page with a datagrid on it. The Datagrid has bound template columns. The columns of the datagrid pass the bound data value of...
0
by: Mark Rodrigues | last post by:
Hi Everyone, I have been fighting a problem for a while and I wonder if someone out there can help. This problem has been presented in a number of news postings previously but I am yet to see a...
0
by: Sam Miller | last post by:
I have several text boxes like FirstName, LastName, etc; the usual. When the page is loaded I fill in the values from a member record. Like: Session("FirstName") =...
2
by: Paul K | last post by:
I have the user selecting a record on one page of the web app I'm working on. After they select a record, I save the record into a session variable and submit the main page (in another window). In...
4
by: Jon Paal | last post by:
I captured an arraylist into a session value but to display the current values, the page requires a postback or else it displays the prior version of the value. how do I force a post back...
2
by: VSingh | last post by:
I have a form in a C# ASP Dotnet application. There is code in both the !Postback and Postback section. The code in Postback section always executes on the development box but when I deploy the app...
4
by: John Wright | last post by:
I use the following code to set a session variable for people I have authenticated to my site: For Each row As DataRow In foundRow Session("Login") = row.Item(1).ToString Exit For Next
2
by: =?Utf-8?B?SlA=?= | last post by:
Hi all. I'm having a problem with a postback issue and I think it's cache related. Here's my setup: I have a web site that has a signup section. This has simple things like name, age, birth...
4
by: tiago.private | last post by:
Hi everybody, Imagine the following scenario: One System.Web.UI.UserControl (UC1) with 2 drop downs and one button "Filter" One Webform with (UC1) and a GridView, basically the UC1 provides...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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...

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.