deeayrian
asked on
Cannot get cookie counter to increment
My assignment requires that I show how many times a user has visited the site by using a cookie to count in Perl. Although cookies are very simple, for some reason, I can not get my cookie to count past 1. I have compared my information to online sources and it all looks correct, but not matter what it doesn't work. Please view my code below. Thank you!
#retreive count cookie
$count = cookie('Count');
$count++; (there are two plus signs here but for some reason the preview isn't showing them)
#there is a name cookie created here as well
$C_count = cookie(-name => "Count",
-value => "$count",
-expires => "+6M");
print header(-cookie => $C_name, $C_count);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
print header(-cookie => [$C_name, $C_count]);
Thank you!