[Zope-dev] Cookies and IE
Austin Mayberry
austin@tool.net
Wed, 06 Jun 2001 17:39:24 -0400
I am having a problem with cookies in Internet Explorer. Zope will not
allow cookies in IE to have -'s or ,'s. The problem extends from the
fact that IE does not quote the environment variable HTTP_COOKIE, so
Zope has separate regular expressions to deal with HTTP_COOKIE in
Netscape and IE when parsing HTTP_COOKIE into the cookies dictionary.
This is handled in the parse_cookie method of HTTPRequest.py. The first
reg exp below is for Netscape and the second is the one it uses for IE.
I understand why the one for IE does not allow for spaces, \0's, "'s,
and ;'s because those are possible delimeters of the end of a cookie
value, but I do not understand why it excludes -'s and ,'s. Does
anyone know the reasoning behind this?
qparmre=regex.compile(
'\([\0- ]*'
'\([^\0- ;,=\"]+\)="\([^"]*\)\"'
'\([\0- ]*[;,]\)?[\0- ]*\)'
)
parmre=regex.compile(
'\([\0- ]*'
'\([^\0- ;,=\"]+\)=\([^\0- ;,\"]*\)'
'\([\0- ]*[;,]\)?[\0- ]*\)'
)