[EMAIL PROTECTED] wrote:
Hi All
I have to read a domain cookie set
by a ColdFusion Web Server on a different host. CF sets a cookie value
like
[EMAIL PROTECTED]|2004-10-22
16:16:41|70DC39BB99CB4CB826E3F30AA25D97FE
I can read this cookie with CGI.pm,
and it seems to identical. When I try to get the same cookie value
using Apache::Cookie, it gets returned as
[EMAIL PROTECTED]|2004-10-22+16:16:41|70DC39BB99CB4CB826E3F30AA25D97FE
Note the '+' between the date and
time. Unfortunately, this breaks everything, as I need the first two
pipe delimited values to hash to the third value (using a key in
addition to this). Does anyone know why this would happen, and if there
is a workaround?
If I were to hazard a guess, I would say that Apache::Cookie is URL
encoding the cookie. If you URL decode the value returned from
Apache::Cookie, you should get the same value that is being reported by
CGI.pm and Cold Fusion.
As a poor man's URL decode, you could try something like:
$cookie =~ s/+/ /g;
This will replace the '+' with a space in the value returned by
Apache::Cookie and leave the value returned by CGI.pm unaffected.
HTH.
Ian
|