こちらと同じことを、Perl の CGI で行いました。
jquery-cookie の使い方
クッキーを送る
cookie_put.pl
#! /usr/bin/perl
#
# cookie_put.pl
#
use strict;
use warnings;
#
print "Set-Cookie: message='Good Morning by Perl';SameSite=None;Secure;\n";
print "Set-Cookie: aa='おはようございます。Perl';SameSite=None;Secure;\n";
print "Set-Cookie: bb=Test_bb by Perl;SameSite=None;Secure;\n";
print "Set-Cookie: cc=Test_cc by Perl;SameSite=None;Secure;\n";
print 'Content-Type: text/html',"\n";
print "\n";
print "\n";
print "<!DOCTYPE html>";
print "<html lang=\"ja\">";
print "<head>";
print "<title>cookie put</title>";
print "</head>";
print "<body>";
print "cookie_put.pl<p />";
print "Aug/14/2020<p/>";
print "</body>";
print "</html>";
クッキーを確認
cookie_get.pl
#! /usr/bin/perl
#
# cookie_get.pl
#
use strict;
use warnings;
use CGI::Cookie;
my %cookies = fetch CGI::Cookie;
my $message = "";
my $aa = "";
my $bb = "";
my $cc = "";
if(exists $cookies{'message'}){ $message = $cookies{'message'}->value; }
if(exists $cookies{'aa'}){ $aa = $cookies{'aa'}->value; }
if(exists $cookies{'bb'}){ $bb = $cookies{'bb'}->value; }
if(exists $cookies{'cc'}){ $cc = $cookies{'cc'}->value; }
print "Content-type: text/html\n\n";
print "<!DOCTYPE html>";
print "<html lang=\"ja\">";
print "<head>";
print '<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8" />';
print "<title>cookie get</title>";
print "</head>";
print "<body>";
print "message: " . $message . "<p />";
print "aa: " . $aa . "<p />";
print "bb: " . $bb . "<p />";
print "cc: " . $cc . "<p />";
print "cookie_get.pl<p />";
print "Aug/14/2020<p/>";
print "</body>";
print "</html>";