Handle multiple "set-cookie" headers.
Use b64encode instead of encodestring.

* PageSpeed doesn't recognize newlines in the base64-encoded content.