I dived into CGI.pm, and I found what probably the problem is.

When one calls CGI->cookie(), CGI will create a default query object, 
stored in the package global $CGI::Q, and in CGI::cookie(), it does 
some caching for performance issues. That seems to make things screwed up.

It follows that all mod_perl scripts are sharing the same $CGI::Q, if 
they `use CGI qw(:standard)' to import the methods.

Kenneth


"Randal L. Schwartz" wrote:
> 
> >>>>> "Kenneth" == Kenneth Lee <[EMAIL PROTECTED]> writes:
> 
> Kenneth> Hi perlers,
> Kenneth> It seems that CGI->cookie() is not always returning the right thing.
> 
> Kenneth> For example, three clients A, B and C send to the server three different
> Kenneth> session keys X, Y and Z repectively. In some circumstances, CGI->cookie()
> Kenneth> gives Y as A's cookie, Z as B's and X as C's, while they _are_ sending
> Kenneth> the correct ones. The problem seems to be solved now by replacing
> Kenneth> CGI-> cookie() with CGI::Cookie->fetch.
> 
> You know, I'd give a wager that this is because CGI::cookie is not
> always recognizing that the first parameter is "CGI" when called
> as CGI->cookie().  In fact, I had a problem the other day with that
> too.  Try changing CGI->cookie() (not documented as working, I see
> only instance calls, not class calls in "perldoc CGI") with CGI::cookie().

Reply via email to