|
Manera, Villiam
vmanera at manord.com
Fri Nov 28 18:08:11 EST 2003
I'm sorry but still don't work.
I'm removed all references to cgi and I moved all my directory with .py
under document root:
DocumentRoot "C:/wwwroot/cartelle_sito_mdn"
<Directory "C:/wwwroot/cartelle_sito_mdn/script/cgi/cgi-py">
and with this new configuration req.headers_out:
{'Set-Cookie': 'pysid=d4d10ab8e7917b43becbff01a2452f7e;
path=/script/cgi/cgi-mpy/\', 'Cache-Control': 'no-cache="set-cookie"'}
and if I relod the page it never passed to req.headers_in
if I modify se session module:
def make_cookie(self):
....
c.path = '' #dirpath[len(docroot):]
then req.headers_out become:
{'Set-Cookie': 'pysid=fb35b851ad27e7effe820c36871bc9b4; path=',
'Cache-Control': 'no-cache="set-cookie"'}
and If I relod the page it go to req.headers_in:
{'Cookie': 'pysid=fb35b851ad27e7effe820c36871bc9b4', 'Connection':
'Keep-Alive', ...}
and req.heades_out : {}
so why if something else then '' is in path the pysid wasn't writing into
the html heading?
Villiam
-----Messaggio originale-----
Da: Gregory (Grisha) Trubetskoy [mailto:grisha at modpython.org]
Inviato: mercoledì 26 novembre 2003 22.03
A: Manera, Villiam
Cc: mod_python at modpython.org
Oggetto: Re: [mod_python] Problem with Session module with multiple
scriptalias not under t he document root
You should start addressing this by removing all reference to CGI. You
don't need (and shouldn't use) any ScriptAlias directives to make
mod_python work, since it has nothing to do with CGI at all.
Once all your directories containing Python code are under DocumentRoot, I
think it will work correctly.
Grisha
On Wed, 26 Nov 2003, Manera, Villiam wrote:
> 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
>
>
>
|