Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cookie Help

Status
Not open for further replies.

NateBro

Programmer
Sep 1, 2004
233
US
this is what i would like the program to do, i'm using CGI:: and $q is a new CGI object :)
Code:
# Cookie_Main(i/o, name(s), value(s), time(s));
sub Cookie_Main(){
my ($I_O, @Name, @Value, @Time) = @_;
	if ($I_O){
	# Write Cookie
	my $I=0;
	my @cookies;
		foreach (@Name){		
		push(@cookies, $q->cookie(-name => $_, -value => $Value[$I], -path => '/', -expires => $Time[$I]));
		$I++;
		}
	print $q->header(-cookie => @cookies);
	return 1;
	} else {
	# Read Cookie
	my $I=0;
	my %cookies;
		foreach (@Name){
		$cookies{"$_"} = $q->cookie("$_");		
		$I++;
		}
	my $cookie_password = v
	return %cookies;
	}
}
I'm not sure what all i'm doing wrong, but most likely a lot! well, am i going in the right direction, or should i stop now and try a completely different way?

thanks!
~Nate_Bro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top