PHP: 使用cookie的方式
我在PHP中执行了与此相似的操作。
jquery-cookie的用法
Perl:cookie的用法
发送饼干
<?php
// ------------------------------------------------------------------
//
// cookie_put.php
//
setcookie('message','これはテストです。by PHP',['samesite' => 'None', 'secure' =
> true]);
setcookie('aa','りんご by PHP',['samesite' => 'None', 'secure' => true]);
setcookie('bb','ぶどうby PHP',['samesite' => 'None', 'secure' => true]);
setcookie('cc','桃 by PHP',['samesite' => 'None', 'secure' => true]);
echo "<!DOCTYPE html>";
echo "<html lang=\"ja\">";
echo "<body>";
echo "Aug/14/2020<p/>";
echo "</body>";
echo "</html>";
// ------------------------------------------------------------------
?>
确认一下饼干
<?php
// ------------------------------------------------------------------
//
// cookie_get.php
//
echo "<!DOCTYPE html>";
echo "<html lang=\"ja\">";
echo "<body>";
echo "message: " . $_COOKIE['message'] . "<br />";
echo "aa: " . $_COOKIE['aa'] . "<br />";
echo "bb: " . $_COOKIE['bb'] . "<br />";
echo "cc: " . $_COOKIE['cc'] . "<br />";
echo "Aug/14/2020<p/>";
echo "</body>";
echo "</html>";
// ------------------------------------------------------------------
?>