无法删除 PHP 中 $_COOKIE 中返回的编码(在 MAMP 服务器上)

Can't remove encoding returned in $_COOKIE in PHP (on MAMP Server)

我终于让 cookie 只为我的输出工作,如下所示:

You last requested an internship opportunity on Wednesday%2C+November+15%2C+2017%2C+3%3A+33+AM.

我尝试过使用 urldecode()、rawurldecode()、setrawcookie()、implode() 和 explode()。 None 其中对输出有任何影响,我还没有在类似问题中看到其他建议。如果有人知道什么可能有效,我将不胜感激。

下面我包含了一些代码(涉及两个文件,所以除非必要,否则我不会 post)。

从页面顶部提取的 Cookie 信息

if(isset($_COOKIE['LastRequestDate']))
    $LastRequestDate = $_COOKIE['LastRequestDate'];
else
    $LastRequestDate = "";

显示的 Cookie 变量

echo "<p>You last requested an internship opportunity on ".$LastRequestDate."</p>";

这是从另一个页面设置 cookie 的代码。我试过删除 urlencode() 但没有任何变化。

setcookie("LastRequestDate", urlencode($DisplayDate), time()+60*60*24*7, "/");

使用:

<?php
  $DisplayDate = date("l jS \of F Y h:i:s A") ;
  $base64 = base64_encode($DisplayDate);

  setcookie("LastRequestDate", $base64, time()+60*60*24*7, "/");

  $LastRequestDate = $_COOKIE['LastRequestDate'];
  echo base64_decode($LastRequestDate);
?>