[mod_python] Problem with Session module with multiple scriptalias not under t he document root

Manera, Villiam vmanera at manord.com
Wed Nov 26 14:58:00 EST 2003


First of all my configuration<?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" />

 

>From httpd.conf:

.....

    DocumentRoot "E:/wwwroot/cartelle_sito_mdn"

....

    ScriptAlias /cgi-mpy/ "E:/script/cgi/cgi-mpy/"

    ScriptAlias /produzione/ "E:/script/cgi/produzione/"

    ScriptAlias /organizzazione/ "E:/script/cgi/organizzazione/"

.........

    <Directory "E:/script/cgi/cgi-mpy">

...

                AddHandler python-program .py

                PythonHandler mod_python.publisher

            PythonPath ....

                PythonDebug on

                  #PythonOption ApplicationPath /cgi-mpy

               PythonOption SessionDbm
'E:/wwwroot/dati_autenticazione/sid/session.dbm'

   </Directory>

 

if I miss PythonOption ApplicationPath ... in any directory:

 

    def make_cookie(self):

            ....

        if config.has_key("ApplicationPath"):

            c.path = config["ApplicationPath"]

        else:

            docroot = self._req.document_root()

            # the path where *Handler directive was specified

            dirpath = self._req.hlist.directory 

            c.path = dirpath[len(docroot):]

 

so the req.headers_out generate this html heading for cgi-mpy scriptalias:

{'Set-Cookie': 'pysid=596d8102cb1dcbf389117fb7d6a497ba; path=',
'Cache-Control': 'nocache="set-cookie"'}

 

where path=  because len(document root) :28 len (dirpath) 21

 

and in this way all work fine for all my scriptalias except for

 ScriptAlias /organizzazione/ "E:/script/cgi/organizzazione/"

In this case len(dirpath) = 30 so path='/\'

And I make the first connection under this path any attempt to call url
under other scriptalias cause a new session because the hader miss the key
'Set-Cookie'....

 

So I tryed to use:

PythonOption ApplicationPath /cgi-mpy

PythonOption ApplicationPath /organizzazione

....

If my first connection is under cgi-mpy all work fine for all the url under
cgi-mpy, but any attempt to connect to un url under a different scriptalias
cause a new session

 

So I may choose to change orgenizzazione in organiz, or to modify the
session module: c.path=''

Any other suggestion?

 

Villiam Manera 
Dirett.  Sistema Informativo 

Manifatture del Nord srl 
viale Regina Elena 13-15 
42100 Reggio Emilia RE 
ITALY 

Tel. +39 0522 508200 
Fax +39 0522 514099 
email : vmanera at manord.com 
www.pennyblack.com 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.modpython.org/pipermail/mod_python/attachments/20031126/83e74c70/attachment-0003.htm


More information about the Mod_python mailing list