[Zope] cookie problem

Stuart 'Zen' Bishop zen@cs.rmit.edu.au
Mon, 31 Jan 2000 12:34:07 +1100 (EST)


On Mon, 31 Jan 2000, Terry Kerr wrote:

> Hi,
> 
> I am having problems trying to set a cookie when the cookie is a pickled
> object.  It appears to be a problem when the string representation of
> the pickled object containes carrage returns. ...setCookie seems to barf
> in this situation.  Anyone else had problems with this and/or found work
> arounds?
> 
> PS I am using zope 2.1.3 from src.

from base64 import decodestring, encodestring

cookie = encodestring(pickledstuff)

And to reverse

pickledstuff = decodestring(cookie)

-- 
 ___
   //     Zen (alias Stuart Bishop)     Work: zen@cs.rmit.edu.au
  // E N  Senior Systems Alchemist      Play: zen@shangri-la.dropbear.id.au
 //__     Computer Science, RMIT 	 WWW: http://www.cs.rmit.edu.au/~zen