I checked three things as you suggested - and everything looks good:
1. WebConfig does not have the following entry: [sessionState mode="Off"]
Rather, mode is "InProc"
2. The pages in question do not have the following directive: [@
Page...EnableSessionState="ReadOnly"...]
3. IIS Configuration has the defaults [Enable Session State] checked, with
the timeout default of 20 minutes.
When I add the following line to Session_Start
Response.Write(Session.SessionID);
I get a different value for SessionID on every successive page I open. It
even happens for my login page when I enter invalid credentials and it
simply redisplays the same page. This tells me that it is actually starting
a new session for each page sent to the browser.
FWIW, I'm using VS.NET 2003 on WinXP Pro/SP1, clean install, machine is
stable, IIS is running with defaults installation settings. I have observed
this behavior on two different ASP.NET applications I'm developing on this
machine. Both are C# and use code-behind modules.
Any other ideas?
I really appreciate the help - don't know what else to look at.
-Jeff
Jerry Boone said:
By the way, sessions should only start once and keep a session id that is
accessible by doing response.write(session.sessionid)
The start event will only fire once for the length of your session which is
determined in IIS under your websites Home Directory-Configuration-Options
(default is 20 minutes). Once that expires and your user clicks something,
they will trip the start event and get a new session id, which is bad if you
rely on session variables to store the data in server RAM. Hence, the
improvements to use a state server, sql server, and other ways to maintain
state.
--
Jerry Boone
Analytical Technologies, Inc.
http://www.antech.biz
Secure Hosting and Development Solutions for ASP, ASP.NET, SQL Server, and
Access
during