| Are you doing anything with Session in the Session_Start |
| Peter Bromberg replied to Seth Bailey on Friday, November 10, 2006 5:43 PM |
|
eventhandler in Global.asax? Are you making any calls to Response.Flush?
Session state id is stored in a cookie. This cookie is a header, and it has to be written before any content is written to the output stream. if you do a flush, no headers can be written. Without looking at your code, the fact that you are saying it seems to happen "the first time" only, that's why my comments.
|
| Reply Reply Using Power Editor |
| Peter Bromberg is a C# MVP, MCP, and .NET expert who has worked in banking, financial and telephony for over 20 years. Pete focuses exclusively on the .NET Platform, and currently develops SOA and other .NET applications for a Fortune 500 clientele. Peter enjoys producing digital photo collage with Maya,playing jazz flute, the beach, and fine wines. You can view Peter's UnBlog and IttyUrl sites. Please post questions at forums, not via email! |  |
|
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
| Not using Response.Flush or Event Handlers |
| Seth Bailey replied to Peter Bromberg on Friday, November 10, 2006 6:05 PM |
|
Thanks for responding Peter.
No, I am not making any calls to Response.Flush nor am I using any event handlers in the Global.asax.
I read elsewhere that people have been experiencing alot of problems with session loss in .Net 2.0 due to the app domain recycling constantly even though no changes where being made to the app or it's directory. However, I've built several web apps from scratch using .Net 2.0 and not had this problem, just the ones I convert from .Net 1.1. Also, it's difficult to test since I can't reliably reproduce the error.
Googling the error showed that quite a few other people have had the same problem after upgrading a working 1.1 app to 2.0 but I can't find anything on MS's site or elsewhere.
Thanks for your time,
Seth
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
| re |
Jeremiah Jacobs provided a rated reply to Seth Bailey on Friday, November 10, 2006 8:08 PM |
|
you lose session state when the application pool is recycled (unless you r using sql server to store your sessions, of course) if that is your problem, and it occurs frequently, then someone missconfigured your webserver as app. pool recycling can be regulated in IIS. i personally think that the error message received sounds like its the app_pool... just a guess, but i'd take a look at the iis settings... try putting the app in a seperate pool for testing, or regulate the recyle settings.
jj
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
| Try this |
| David Weprin replied to Seth Bailey on Wednesday, December 06, 2006 2:32 PM |
|
Make sure you are not doing a Response.Redirect() inside your Session_Start event handler in global.asax.vb. Response.Redirect() causes the Session to be flushed. And in Session_Start, the Session is not in a state that is ready to be flushed.
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
| Solution to problem when upgrading from 1.1 to 2.0 |
Francisco Gutierrez provided a rated reply to Seth Bailey on Monday, April 23, 2007 1:17 PM |
|
Hi,
I had no Session_start events or any others, no Response.Redirect and I was experimenting the problem. When I saw this post I realized that the problem is with upgrade because usually you forget to re-compile all the DLLs you made in 1.1 with the 2.0 compiler. So that is what I did and IT WORKED!!!, no more problems!
Hope this helps someone.
|
| Reply Reply Using Power Editor |
| |
| |
Rank |
Winnings |
Points |
| November |
0 |
$0.00 |
0 |
| October |
0 |
$0.00 |
0 |
|
|
|
|
|
|
|