in reply to Re: Re: Perl and cookies...
in thread Perl and cookies...

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!