SV: set cookie problem (slightly OT)

Carsten Gehling carsten at gehling.dk
Wed Apr 30 05:31:38 EDT 2003


> Fra: python-list-admin at python.org
> [mailto:python-list-admin at python.org]På vegne af drs
> Sendt: 30. april 2003 04:13
> Emne: set cookie problem (slightly OT)
>
>
> I have a web directory (apache2/FreeBSD) with ssi enabled but not cgi.  in
> order to run simple python scripts i use something like
>
> <!--#exec cmd="/usr/local/bin/python /path/to/script.py" -->
>
> which works surprisingly well.  I cannot figure a way to set a cookie,
> however, as i am not able to add to the header. Anyone have any
> suggestions?

Normally, Apache (and other webservers like IIS) pre-process headers UNLESS
you prefix the script name with "nph-". Try to do this:

<!--#exec cmd="/usr/local/bin/python /path/to/nph-script.py" -->

And - of course - rename your script accordingly. I haven't tried it, but it
should give you greater control with the headers.

- Carsten






More information about the Python-list mailing list