set cookie problem (slightly OT)

drs drs at ecp.cc
Wed Apr 30 16:59:59 EDT 2003


"Carsten Gehling" <carsten at gehling.dk> wrote in message
news:mailman.1051695171.12347.python-list at python.org...
> > 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.

[I might note that this is totally off topic now, but maybe worth
mentioning]

The above solution does not seem to work.  My guess is that once ssi has
started, headers are already written.  Instead, I added the following to a
.htaccess file

<Files index.html>
    Header add Set-Cookie "name=value"
</Files>

-d






More information about the Python-list mailing list