Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: CGI and Redirect/URI/Location

by LeGo (Chaplain)
on Jun 19, 2001 at 01:58 UTC ( [id://89486]=note: print w/replies, xml ) Need Help??


in reply to Re: CGI and Redirect/URI/Location
in thread CGI and Redirect/URI/Location

here is where I am now...
This works in Netscape but not IE?
$c = new CGI::Cookie(-name => 'login', -value => $login2, -expires => '+3M', ); $d = new CGI; print $d->redirect(-cookie=>$c, -location=>"$URL");
This works in IE but not Netscape?
$c = new CGI::Cookie(-name => 'login', -value => $login2, -expires => '+3M', -domain => '.mydomain.com' ); $d = new CGI; print $d->redirect(-cookie=>$c, -location=>"$URL");
I didn't think that the domain should make a difference for IE but it did. So I tried adding -nph=>1 to both $c and $d seperately. When I added it to $c it did not do anything. When I added it to $d it gave an Internal Service Error.

Are there any comments or suggestions that I might be missing on my code here? I would like for it to work in both IE and Netscape obviously.

Also anyone know why netscape takes about 5 seconds to process and IE doesn't take any time?

LeGo

Replies are listed 'Best First'.
Re: Re: Re: CGI and Redirect/URI/Location
by Hero Zzyzzx (Curate) on Jun 19, 2001 at 04:14 UTC

    I'm confused. You seem to be mixing function and OO calls to CGI. I'm not sure if this is causing your problem, but it might. I've never experienced issues with cookies working with one browser and not the other.

    Some things to try:

    1. Use all OO calls to CGI, thusly:
      my $q = new CGI; my $c = $q->Cookie(-name => 'login', -value => $login2, -expires => '+3M', -domain => '.mydomain.com' ); print $q->redirect(-cookie=>$c, -location=>$URL);
    2. I doubt this will mean anything, but I don't think you need the double quotes around $URL.
    3. You can only set a cookie for the domain that the script was requested from. . .as a security measure. If your domain is "foo.com" you can only set a valid cookie for this domain. I think you're aware of that, given the way you set your domain in your cookie. So if your redirect is to a different domain, you can't set a cookie for that domain, only the old one.

    Good Luck!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://89486]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found