in reply to Perl and cookies...

The cookie specification only allows cookies to be shared across sites if those sites are in the same subdomain. So, for example, you can't have the www.foo.com server set a cookie and have the www.bar.com server see it. You could have the store.foo.com server see a cookie set by www.foo.com -- they're in the same domain.

So question number one is whether these sites are all in one domain.

Replies are listed 'Best First'.
Re: Re: Perl and cookies...
by powerhouse (Friar) on Feb 24, 2003 at 08:36 UTC
    Ok, No, they are all different domains.

    So I guess I'm SOL :o{

    I wonder how Microsoft Passport does it...

    Oh well, that's another topic ;o}

    thx,
    Richard
      MS passport loads an image from passport.msn.com and then they just put that image on every page that there is a passport login. So you could do it that way: something like:
      <img src="http://yourdomain.com/setcookie.cgi" alt="" /> you just need to make your 'setcookie.cgi' header send the cookie you want to set and then tell it to print the location of an image. Something like this: (untested)
      #!/usr/bin/perl -T use strict; use warnings; use CGI; my $cgi = new CGI; my $cookie = $cgi->cookie(-name =>'somename', -value =>'somevalue', -path =>'/', -expires=>'+10y', #long cookie -domain =>'yourdomain.com', ); print $cgi->redirect( -cookie=>$cookie, -uri =>'http://yourdomain.com/someimage.png');

      The only caveat is that some ad-blocking software blocks this as it is normally used to track people. This is especially true if you make the image a 1x1 transparent GIF. But if you aren't worried about that this should be the solution you are looking for.

      Hope that helps
      Chris

      Lobster Aliens Are attacking the world!