andrewmilner
asked on
Consistent SessionID C#
I am trying to get the SessionID using Session.SessionID.ToString ()
But everytime the code is fired it gives a different ID but I expected it to stay the same while ever the browser window remained.
What I want is a sustainable ID that I can reference while I user is entering a form. then after the form is completed I would flush the session to force a new one created.
How can I do that with the code?
Thanks in advance,
Andrew.
But everytime the code is fired it gives a different ID but I expected it to stay the same while ever the browser window remained.
What I want is a sustainable ID that I can reference while I user is entering a form. then after the form is completed I would flush the session to force a new one created.
How can I do that with the code?
Thanks in advance,
Andrew.
It should stay the same - can we see some code?
Are you resetting your App pool each time the code runs? Doesn't matter if the same browser window remains open, if the App pool gets restarted or recycled, you're going to lose that information.
Are you using the RemoveAll() [http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.removeall(VS.80).aspx] or Clear() [http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.clear(VS.80).aspx] methods to flush the session? or are you doing something else?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.