[mod_python] newbie cookie confusion

Sells, Fred fred at adventistcare.org
Thu Oct 5 16:27:41 EDT 2006


I've googled but not found this, trying to do cookie example from docs.  The
output is always of type <type 'str'> and is the cookie name.  How do I get
value?



def makecookie(req):
    c = Cookie.MarshalCookie('spam', 'eggs', 'secret007')
    d = Cookie.MarshalCookie('xxxx', 'yyy', 'secret007')
    Cookie.add_cookie(req, c)
    Cookie.add_cookie(req, d)
    return 'cookie made'

def showcookies(req):
    cookies = Cookie.get_cookies(req, Cookie.MarshalCookie,
secret='secret007')
    s = 'There are %s cookies'% len(cookies)
    for c in cookies:
        s += '\n%s %s' % (str(c), type(c))
    return s

---------------------------------------------------------------------------
The information contained in this message may be privileged and / or
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited. If you
have received this communication in error, please notify the sender
immediately by replying to this message and deleting the material from any
computer.
---------------------------------------------------------------------------



More information about the Mod_python mailing list