I need some help with my script. i have the code below, which i think will do what i want it to. How can i make it into an actual working page? At the moment it just gives me "internal server error"
I basicly have a program that sets a cookie using the pm_encode function. i am trying to make a page that will grab the cookie decode it using pm_decode and place the cookie back with a different name. Any help is greatly apreciated.
David
#!/usr/bin/perl
###############################
# find the root if this is IIS:
###############################
if($ENV{'SERVER_SOFTWARE'} =~ m/IIS/)
{
if($root eq "" && $ENV{'PATH_TRANSLATED'} ne "")
{
my $pt = $ENV{'PATH_TRANSLATED'};
my @pts = split(/\\/, $pt);
$pts[-1] = "";
$root = join "/", @pts;
$OS = "NT";
}
}
my $lp = $req->cookie("pmpre");
my ($clogin, $cID) = split(/\|/, pm_decode($lp));
my $cookie_pmpre_login = $req->cookie(
-NAME => "username",
-VALUE => "$clogin",
-EXPIRES => "+1y",
-PATH => "/"
);
print $req->header(-COOKIE => $cookie_pmpre_login);
exit;