PDA

View Full Version : Session ID keeps changing


marc12
02-21-2004, 02:28 AM
Found this at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnetsessionstate.asp?f

"An important point about ASP.NET session management is that the life of a session state object begins only when the first item is added to the in-memory dictionary. Only after executing code like in the following snippet, can an ASP.NET session be considered started."

Session["MySlot"] = "Some data";

So I included the comparable VB code in my app and that fixed it.

marc12
02-21-2004, 12:02 PM
I have a simple VB aspx page with the following in Page_Load:

objSession = Context.Session()
Textbox2.Text = objSession.SessionID()

There is a Button2_Click class which for now doesn't do much except to cause a page load. On my development system the value of the SessionID remains constant when I continually click button2. That's the desired behavior. But on my DASP site the sessionID continually changes.

My web.config contains the following:

<sessionState mode="InProc" cookieless="false" timeout="20" />

How do I keep the session state constant?

Thanks,
Marc