Issue Details (XML | Word | Printable)

Key: MODPYTHON-17
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Nicolas Lehuen
Reporter: Nicolas Lehuen
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

Big marshalled cookies cause an error

Created: 01/Feb/05 05:10 AM   Updated: 05/Mar/06 01:40 PM
Return to search
Component/s: None
Affects Version/s: 3.1.3
Fix Version/s: 3.2.7

Time Tracking:
Not Specified

Resolution Date: 01/Feb/05 05:13 AM


 Description  « Hide
From the mailing list :

While fiddling around with mod_pyhon 3.1.3 MarshalCookies and IE6, I
noticed that once a cookie got to a certain size, it would stop being
recognized as a valid Marshal cookie. I suspect (although I don't know
for sure -- I'm not currently in a position to build mod_python) the
problem is the following:

In MarshalCookie's "def __str__(self):" method, base64.encodestring() is
used to encode the cookie value. Unfortunately, base64.encodestring()
adds newline characters to the byte stream every 76th byte, which seem
to cause the problem. The terminal newline is stripped, but none of the
internal ones.

I would suggest that the line:
m = base64.encodestring(marshal.dumps(self.value))[:-1]

be replaced by something like:
m = base64.encodestring(marshal.dumps(self.value))
m = "".join(m.split("\n"))

Regards, Steve McAdams


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Nicolas Lehuen made changes - 01/Feb/05 05:13 AM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Assignee Nicolas Lehuen [ nlehuen ]
Resolution Fixed [ 1 ]
Graham Dumpleton made changes - 05/Mar/06 01:40 PM
Status Resolved [ 5 ] Closed [ 6 ]