开发者

Cookie Expiration times

Is is possible to find out when a cookie expires, I have set my cookie up doing this

$_COOKIE[] = setcookie("bangUser", $unique, time() + (60*60*24*30));

is possible to print out is expiration date on scre开发者_如何学编程en somehow?


Yes, you can use the date function to print out a pretty version of the timestamp that you are passing into your setcookie function. An example of the code you could implement is below. You could change the date format using the guide on this page.

$expireat = time() + (60*60*24*30);
setcookie("bangUser", $unique, $expireat);
echo date("l jS \of F Y h:i:s A",$expireat)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜