Gossamer Forum
Home : General : Perl Programming :

Using & in a cookie value

Quote Reply
Using & in a cookie value
Hi,

I am working on a program that has to emulate a browser, and log into the My UPS website. Everything was going fairly smoothly until one of the cookies it sent, contained an "&".

Specifically they send:

Code:
session_ups_com=1020737632&mycompany&0&GMi+QdG9tEbLeLGzyfBNfTTzji7x80rp;domain=.ups.com;path=/
To send it back with my next page request, I parsed out the actual cookie value and did this:
Code:
my $http = new GT::URI::HTTPS(
'request_method' => 'POST',
'headers' => { Referer => 'https://www.ups.com/servlet/login?returnto=https://www.ups.com/ups.app/iss.class',
},
'cookies' => { test_ups_com => 'init',
session_ups_com => '1020736548&mycompany&0&YK5eYeY3By+w3SFqYlqm9FdH8KEEqnaJ'
},
'parameters' => {},
'agent_name' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)'
);
$http->fetch( $url );


And yes... as odd as it sounds... this is part of a Links SQL Plugin... so its using the GT library... So what happens here is it gets stuck... and it gives me a message saying I have to log in again.

To debug this... I did this post to my links install forcing an error, and it shows the second cookie as only being: 1020736548.... Cutting off at the &.

Obviously the & works when using the web browser.... however it seems that somewhere in one of the modules, the & cuts off the cookie before it gets sent out with the request headers.

Just in case... here is the version info on my URI::HTTPS module:
Code:
# ==================================================================
# Gossamer Threads Module Library
#
# GT::URI::HTTP
# Author : Aki Mimoto (support@gossamer-threads.com)
# CVS Info : 087,069,093,087,083
# $Id: HTTPS.pm,v 1.5 2001/02/11 01:11:24 aki Exp $
#
# Copyright (c) 2000 Gossamer Threads Inc. All Rights Reserved.
# ==================================================================
#
# Description:
# Gets HTTP data
#package GT::URI::HTTPS;
Does anyone know if this is a bug in the GT package.... or how I can get around this?



Best regards,

AlexJ
Subject Author Views Date
Thread Using & in a cookie value AlexJ 8308 May 6, 2002, 7:42 PM
Thread Re: [AlexJ] Using & in a cookie value
Aki 8148 May 6, 2002, 9:55 PM
Thread Re: [Aki] Using & in a cookie value
AlexJ 8096 May 7, 2002, 7:04 AM
Thread Re: [AlexJ] Using & in a cookie value
Aki 8078 May 7, 2002, 9:14 AM
Thread Re: [Aki] Using & in a cookie value
AlexJ 8125 May 7, 2002, 10:12 AM
Thread Re: [AlexJ] Using & in a cookie value
Aki 8072 May 7, 2002, 11:15 AM
Thread Re: [Aki] Using & in a cookie value
AlexJ 8088 May 7, 2002, 11:31 AM
Thread Re: [AlexJ] Using & in a cookie value
Aki 8150 May 7, 2002, 12:11 PM
Thread Re: [Aki] Using & in a cookie value
AlexJ 8082 May 7, 2002, 5:09 PM
Post Re: [AlexJ] Using & in a cookie value
Wil 8035 May 8, 2002, 1:31 AM
Thread Re: [Aki] Using & in a cookie value
jykchang 7993 Jun 23, 2002, 10:41 PM
Post Re: [jykchang] Using & in a cookie value
jykchang 7957 Jun 23, 2002, 11:57 PM