From: George H. <fr...@di...> - 2004-10-14 10:57:22
|
On Wed, 13 Oct 2004 23:47:42 -0500 "Gerald W. Lester" <Ger...@co...> wrote: > Colin McCormack wrote: > > >On Thu, 2004-10-14 at 10:59, Jeff Smith wrote: > > > > > > > >>I have seen some similar behaviour when I open > >>multiple forms in a browser and that have the session > >>ID stored in a cookie. I modified my application not > >>to use cookies to store the session ID but instead > >>stored the session ID in the form data and everything > >>worked as expected. > >> > >> > > > >Cookie seems to be a common thread ... is this session-cookie mapping > >something you rolled yourself, or is it using the Session_Cookies > >stuff? It is my own code. > >In any case, Cookies are stored in a global variable - from > >discussions with Brent, it seems possible that globals can be > >corrupted if tclhttpd enters the event loop via a (nested?) vwait and > >another incoming request is serviced. > > > >A solution might be to store cookies per-socket. Needs more feedback > >and investigation. > > > > > Cookies *are* the problem. > > You need to ensure you use the Cookie calls that read them from the > socket and not the uploaded directory. Yes, I was using ncgi::cookie, which reads env(HTTP_COOKIE), which is bad because the env() array is shared across all Tcl threads. I have now modified my code to use Cookie_GetSock instead and the tests run for much longer (5 hours) before failing. My debug log shows correct session state for the new failures so it looks like the cookie problem is fixed but I have a new, and more elusive, bug to track down :( Regards, George |