Matt,
If that is how cookie_jar behaves, it could explain the problem.
I hit www.intervalworld.com first, get a JSESSIONID cookie, then I hit
secure.intervalworld.com - at which WebSphere wants to see my JSESSIONID
from the previous www.intervalworld.com request.
Though the server name is different, it rights a cookie that is for all
subdomains, i.e. in Netscape cookie manager, site name is listed as
"intervalworld.com", and the cookies domain is listed as
".intervalworld.com".
Maybe LWP's cookie jar is not letting secure.domain read cookie data from
www.domain requests.
However, I need that functionality. If cookie_jar get support it, thats
fine, I have no problem doing it by hand, but I dont know how to manually
insert the cookie data into the request header and the 2nd request.
I have verified that the secure.intervalworld.com POST/GET works - but it
will only work when a JSESSIONID cookie is written from
www.intervalworld.com.
Thanks,
John
On Tue, 25 Oct 2005 [EMAIL PROTECTED] wrote:
> QUONIX WEB ADMIN wrote:
> > I've tried using cookie_jar but I cant seem to get it to work.
>
> Clarify... are you sure it isn't working? Maybe the site is expecting
> something else besides cookies.
> > use LWP::UserAgent;
> >
> > $ua = LWP::UserAgent->new(keep_alive => 1);
> > $ua->agent('Mozilla/5.0')
>
> So at this point you'd add the line
> $ua->cookie_jar(HTTP::Cookies->new());
>
> > # Initial non-ssl request to homepage to grab cookies:
> > #
> > # JSESSIONID, serverName, and BIGipServerPROD-EXCHANGE-80
> >
> > my $response_a = $ua->get("http://www.intervalworld.com");
>
> Note the domain... www.intervalworld.com
>
> > # $response_a->header("set-cookie") now contains my three
> > cookies # which I can grab with regular expressions.
> >
> > # Now I need to POST for login and insert those three cookies
> > # in the request header.
> >
> > my %formdata = (
> > login => "abc123",
> > passwd => "xyz456",
> > );
> >
> > # my $response_b =
> > $ua->post("https://secure.intervalworld.com/web/cs", \%formdata )
>
> Ah, the domain is different... www.intervalworld.com ne
> secure.intervalworld.com... so that is why the cookies aren't coming across.
>
> All browsers will consider those two URLs to be on "different sites" because
> the server name is different, and won't pass cookies received on one to the
> other.
>
> Maybe your inputs are incorrect? The form that I see shows three inputs
> named "a", "loginID", and "rememberMe".
>
> --
> Matthew.van.Eerde (at) hbinc.com 805.964.4554 x902
> Hispanic Business Inc./HireDiversity.com Software Engineer
>
>