M
Mark Rodrigues
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
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