List Info

Thread: String encoding in cookies make them be rejected by PHP




String encoding in cookies make them be rejected by PHP
user name
2006-12-20 22:54:24
Gloria wrote:
> Well, I managed to work around this problem by changing
the PHP, so
> that it converts the cookie to what it needs to see.
>
> But, I still want to know how to control cookie
encoding in CherryPy.
>
> Can someone point me to a doc? It's not easily found
through a web
> search.

I found the source code for Cookie.py illuminating:

# These quoting routines conform to the RFC2109
specification, which in
# turn references the character definitions from RFC2068. 
They provide
# a two-way quoting algorithm.  Any non-text character is
translated
# into a 4 character sequence: a forward-slash followed by
the
# three-digit octal equivalent of the character.  Any '' or
'"' is
# quoted with a preceeding '' slash.
#
# These are taken from RFC2068 and RFC2109.
#       _LegalChars       is the list of chars which don't
require "'s
#       _Translator       hash-table for fast quoting
#
_LegalChars       = string.ascii_letters + string.digits +
"!#$%&'*+-.^_`|~"


...so it seems you could extend the set of legal characters
(and
thereby avoid quoting) if you really needed to. But from a
cursory
glance, it looks like the Cookie module gets it right
(according to the
spec), and you should look at PHP's cookie-handling to see
if it even
mentions quoting concerns.


Robert Brewer
System Architect
Amor Ministries
fumanchuamor.org


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en

-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )