Assuming there's a cookie set and it has a value, how do I pull the value of the cookie into a variable?
KizMar
------------
KizMar
------------
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
my ($t) = $ENV{'HTTP_COOKIE'} =~ /t=(\d+)/;
#!/usr/bin/perl -w
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
## Make a CGI object
my $q = new CGI;
### gets the value of the cookie named username into
### the var $cookie_username_get
my $cookie_username_get = $q->cookie('username');
### sets the cookie $cookie_username_set
### to the value of $the_username
my $cookie_username_set = $q->cookie (
-name => 'username',
-value => "$the_username",
-path => '/',
-expires => '+1y'
);