.NET Forum / ASP.NET / Caching / October 2004
New SessionID after each POST
|
|
Thread rating:  |
Anthony - 20 Oct 2004 21:59 GMT I am storing a few string variables to the Session Object in an ASP.Net app. The main page posts back to itself as the user sets options. It also saves the strings to Session. The user can click a button which uses (window.open) to launch a popup. The popup uses the Session variables to display data. This all works fine on my dev machine.
The target web server is having the following problem: A new SessionID is created for each postback and the popup. I enabled tracing and can see that the strings are saved. But on subsequent postback or selection to launch popup, the SessionID changes and any session variables are lost. The app setup is identical on both machines. I've compared all settings in IIS. I'm at a loss. Any ideas?
Thanks, Anthony
Andy Mortimer [MS] - 21 Oct 2004 14:48 GMT Hi, Have you compared settings in the config files and checked to make sure aspnet is not recycling?
Andy Mortimer [MS] Please do not send email directly to this alias. This alias is for newsgroup purposes only
This posting is provided "AS IS" with no warranties, and confers no rights. OR if you wish to include a script sample in your post please add "Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm"
Anthony - 21 Oct 2004 18:04 GMT Andy,
The config files are identical. I watched the aspnet_wp in Task Manager. Its process time seems to increment. How can I verify that aspnet is not recycling?
Thanks, Anthony
> Hi, > Have you compared settings in the config files and checked to make sure [quoted text clipped - 8 lines] > included script samples are subject to the terms specified at > http://www.microsoft.com/info/cpyright.htm" Anthony - 21 Oct 2004 18:17 GMT Andy,
This is not making sense. I went to the properties of the Default Web Server in IIS. I changed the performcance from <10k visitors to <100k visitors and now it's keeping the same SessionID. That is the only change. Any ideas?
Thanks, Anthony
> Hi, > Have you compared settings in the config files and checked to make sure [quoted text clipped - 8 lines] > included script samples are subject to the terms specified at > http://www.microsoft.com/info/cpyright.htm" Anthony - 21 Oct 2004 20:20 GMT Sorry, spoke too soon. Not working. I updated with sp1 for framework 1.1. Modified anti-virus to ignore .asax files. No change and still at a loss.
Thanks, Anthony
> Hi, > Have you compared settings in the config files and checked to make sure [quoted text clipped - 8 lines] > included script samples are subject to the terms specified at > http://www.microsoft.com/info/cpyright.htm" Alvin Bruney [MVP] - 21 Oct 2004 22:25 GMT did this ever work? are you writing to session in the page_load?
 Signature Regards, Alvin Bruney [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx] Got tidbits? Get it here... http://tinyurl.com/27cok
>I am storing a few string variables to the Session Object in an ASP.Net >app. [quoted text clipped - 14 lines] > Thanks, > Anthony Anthony - 21 Oct 2004 22:49 GMT Alvin,
Not working yet. I'm saving session info after click of a control; not in page_load. I installed sp1 for 1.1. I modified anti-virus to ignore .asax files. I verified config files. I put ASPNET local account in Admins just to rule out permissions. I'm using tracing. With it I've verified that session data is being written and that on additional postbacks the SessionID is changing. How can I determine if aspnet_wp is recycling?
Thanks, Anthony
> did this ever work? > are you writing to session in the page_load? [quoted text clipped - 17 lines] > > Thanks, > > Anthony Alvin Bruney [MVP] - 22 Oct 2004 00:25 GMT read this first before you get started http://support.microsoft.com/default.aspx?scid=kb;en-us;555082
 Signature Regards, Alvin Bruney [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx] Got tidbits? Get it here... http://tinyurl.com/27cok
> Alvin, > [quoted text clipped - 38 lines] >> > Thanks, >> > Anthony Anthony - 22 Oct 2004 21:15 GMT Alvin,
This is very odd. I used your test code. I put the session("test") in page_load within an if not postback block. I included the session.abandon in button click.
On my dev machine in debug mode via IDE: I ran perfmon with the following counters: (ASPNET.AppRestarts, ASPNETApps.SessionsAbandoned, ASPNETApps.SessionsActive, ASPNETApps.SessionsTimedOut ,ASPNETApps.SessionsTotal). I put a break point in the session_end event. I launched the app with tracing enabled and see the sessionID stays constant with successive postbacks. When I click the button to abandon the session, (1) the perfmon counter ASPNETApps.SessionsAbandoned increments, (2) the break occurs in the session_end event. However, from tracing, the sessionID is still the same and the session data written is still there. Only when I kill the browser and relaunch does a new SessionID get created.
On the target web server: Same perfmon counters active and tracing enabled. From tracing I see the initial "test" session var. However, on subsequent postbacks, the SessionID is always new and the "test" session var doesn't exist. When I click the button to abandon the session, the perfmon counter ASPNETApps.SessionsAbandoned does not increment.
Summary: Same code on both machines. I use the copy project wizard to deploy code to target web server. On my dev machine, only a browser shutdown seems to generate a new SessionID. On the target web server, every postback generates a new SessionID.
Serenity Now, Anthony
> read this first before you get started > http://support.microsoft.com/default.aspx?scid=kb;en-us;555082 [quoted text clipped - 40 lines] > >> > Thanks, > >> > Anthony Alvin Bruney [MVP] - 23 Oct 2004 17:43 GMT The difference is due to the debug mode on the test server
 Signature Regards, Alvin Bruney [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx] Got tidbits? Get it here... http://tinyurl.com/27cok
> Alvin, > [quoted text clipped - 85 lines] >> >> > Thanks, >> >> > Anthony Anthony - 25 Oct 2004 17:03 GMT Alvin,
The web app on my dev machine operates exactly the same way regardless of being in debug mode or not. The session data is written from the startup page and is accessible via the pop-up page. It's not working the same way on the target web server. Can you give me more than a one sentence response?
Thanks, Anthony
> The difference is due to the debug mode on the test server > [quoted text clipped - 87 lines] > >> >> > Thanks, > >> >> > Anthony Alvin Bruney [MVP] - 26 Oct 2004 01:55 GMT sorry for the one liner - it can be annoying. Post some code that reproduces the problem and i will take a look
 Signature Regards, Alvin Bruney [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx] Got tidbits? Get it here... http://tinyurl.com/27cok
> Alvin, > [quoted text clipped - 112 lines] >> >> >> > Thanks, >> >> >> > Anthony Ola Strandberg - 26 Oct 2004 09:34 GMT Do you use the same client in both scenarios? I am thinking that the client you are using to access the production server has different security settings (i.e. no cookies at all) making it impossible for ASP.Net to track the session id.
Cheers, Ola
> sorry for the one liner - it can be annoying. Post some code that reproduces > the problem and i will take a look [quoted text clipped - 115 lines] > >> >> >> > Thanks, > >> >> >> > Anthony Ola Strandberg - 26 Oct 2004 09:34 GMT Do you use the same client in both scenarios? I am thinking that the client you are using to access the production server has different security settings (i.e. no cookies at all) making it impossible for ASP.Net to track the session id.
Cheers, Ola
> sorry for the one liner - it can be annoying. Post some code that reproduces > the problem and i will take a look [quoted text clipped - 115 lines] > >> >> >> > Thanks, > >> >> >> > Anthony Anthony - 26 Oct 2004 14:47 GMT Alvin,
I posted off the main thread that the problem was due to an underscore in the target server's name. Reference: Q316112 "PRB: Session Variables Do Not Persist Between Requests After You Install Internet Explorer Security Patch MS01-055".
I don't use the news groups often, but I do appreciate the effort that people like yourself make to help solve problems.
Thanks, Anthony
> sorry for the one liner - it can be annoying. Post some code that reproduces > the problem and i will take a look [quoted text clipped - 115 lines] > >> >> >> > Thanks, > >> >> >> > Anthony Anthony - 25 Oct 2004 17:40 GMT In case you are having a similar problem, check Q316112 "PRB: Session Variables Do Not Persist Between Requests After You Install Internet Explorer Security Patch MS01-055".
My target server had an underscore in the machine name which caused my problem of new SessionID every postback and consequently no session data. The resolution is to change the server name or use the IP address when browsing to the web app.
Serenity Now! Anthony
> I am storing a few string variables to the Session Object in an ASP.Net app. > The main page posts back to itself as the user sets options. It also saves [quoted text clipped - 11 lines] > Thanks, > Anthony
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|