[mod_python] Servlets, cookies and redirect

MJR pynode at centrum.cz
Thu Aug 26 19:14:38 EDT 2004


what I was looking for was a method in servlet.py, in addition to
add_cookie(), which would be safe to use before redirect, something like:

===========================================================
  def set_cookie(self, cookie, value="", **kw):
     cookie = Cookie.Cookie(cookie, value, **kw)
     self.req.err_headers_out.add("Set-Cookie", str(cookie))
===========================================================

mike


| -----Original Message-----
| From: mod_python-bounces at modpython.org
| [mailto:mod_python-bounces at modpython.org]On Behalf Of MJR
| Sent: 26 August 2004 17:12
| To: mod_python user mailing list
| Subject: RE: [mod_python] Servlets, cookies and redirect
|
|
| Jim,
|
| I did read that thread, but I am wondering whether there is a
| workaround for
| this is mod_python servlets.
|
| In other words, is there any other way than access req object and
| set cookie
| through instead of using servlets' add_cookie() method?
|
| tx,
| mike
|
|
|
|
| | -----Original Message-----
| | From: mod_python-bounces at modpython.org
| | [mailto:mod_python-bounces at modpython.org]On Behalf Of Jim Dabell
| | Sent: 26 August 2004 17:07
| | To: mod_python user mailing list
| | Subject: Re: [mod_python] Servlets, cookies and redirect
| |
| |
| |
| | > With external_redirect cookie is not set, without redirect it
| works fine
| | > (cookie set). I've obviously missed something... what is a
| | proper way to do
| | > this?
| |
| | I answered this question a few days ago:
| |
| | <URL:http://modpython.org/pipermail/mod_python/2004-August/016178.html>
| |
| | In future, searching the archives is usually a lot quicker than
| posting a
| | question and waiting for somebody to answer.
| |
| | --
| | Jim Dabell
| |
| | _______________________________________________
| | Mod_python mailing list
| | Mod_python at modpython.org
| | http://mailman.modpython.org/mailman/listinfo/mod_python
| |
| |
|
|
| _______________________________________________
| Mod_python mailing list
| Mod_python at modpython.org
| http://mailman.modpython.org/mailman/listinfo/mod_python
|
|




More information about the Mod_python mailing list