[mod_python] Making cookies live byind the current session

Jakob Simon-Gaarde jakob at simon-gaarde.dk
Mon Apr 26 20:26:16 EST 2004

Hi mod_python experts.

I have a problem storing cookies beyond the the session in which they 
are stored. After the first part of code has been run I can see in the 
browsers cookiebrowser that the cookie is available, but if I then close 
the browser and browse the cookeis again it is gone!

The cookie readerpart also works fine until the browser is closed.

What am I doing wrong?

= In the file where I store th cookie =========
   # Store a cookie
   value = {'holdid': int(holdid)}
   Cookie.add_cookie(req, Cookie.MarshalCookie('fodbold',

   cookies = Cookie.get_cookies(req, Cookie.MarshalCookie,

= In another file I read the cookie ===========
   # Read cookie
   if cookies.has_key('fodbold'):
     fodboldcookie = cookies['fodbold']

     if type(fodboldcookie) is Cookie.MarshalCookie and \

More information about the Mod_python mailing list