New Session with each page change

T

Tim F

I can not persist a Session across page changes. I have it configured
as follows:

* VS .NET 2002
* [machine.config]
<pages buffer="true" enableSessionState="true" enableViewState="true"
enableViewStateMac="true" autoEventWireup="true"/>

<sessionState mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424" stateNetworkTimeout="10"
sqlConnectionString="data source=127.0.0.1;user id=sa;password="
cookieless="false" timeout="20"/>


* [web.config]
<sessionState mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data
source=127.0.0.1;user id=sa;password=" cookieless="false"
timeout="20"/>

* enableSessionState is True for all pages.

* All pages use ADO.NET.

I observe that Global.Session_Start is called with every page switch,
so I assume a new Session object is being created; however, each new
Session object is created with the same SessionID. This happens
whether cookieless is true or false.

Is there anything else I should look for? Could ADO.NET be conflicting
somehow? Is this a known VS.NET 2002 issue?

Thanks,

Tim
 
N

Nathan Sokalski

A new Session object is created when you open the browser, and that same one
is used until the browser is closed. Global.Session_Start is called when the
Session is started, not each time a page is requested. If you are looking
for an event that is called each time a page is requested, you want
Global.Application_BeginRequest. If you are looking for a way to end the
current session and start a new one without closing the browser, try looking
at Session.Abandon(). Hopefully something here will help you. Good Luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top