[mod_python] Some questions

Tom Emerson tree at basistech.com
Wed Aug 1 07:21:39 EST 2001


riesch at nieuw.nl writes:
> Cookies
> Is there a way to detect whether a user supports cookies,

No.

> or is that only possible by setting a cookie and not recieving?

Right.

> Globals
[...]

These I'm not sure on, but...

...I believe that the globals are valid for the life of the
interpreter. If you have separate virtual servers running then each
one has its own subinterpreter, and as such the globals should be
valid for each one.

> Every site imports this file. Now I'm not sure whether every site
> now has the same instance, or if every site has a different
> instance. I'm geussing every site has another instance, since it
> defines its own handler and should be run as a separate program, but
> I don't know how mod-python handles this.

You could check by passing a unique value to the __init__ function of
your global object for each site, and examining that value to see if
it is different.

-- 
Tom Emerson                                          Basis Technology Corp.
Sr. Sinostringologist                              http://www.basistech.com
  "Beware the lollipop of mediocrity: lick it once and you suck forever"



More information about the Mod_python mailing list