获取Cookie到期 [英] Get cookie expiration

查看:161
本文介绍了获取Cookie到期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用php读取Cookie到期时间?
当我 print_r($ _ COOKIE)时输出:

Is it possible to read cookie expiration time with php ? When I print_r($_COOKIE) it outputs:

Array
(
    [PHPSESSID] => 0afef6bac83a7db8abd9f87b76838d7f
    [userId] => 1232
    [userEmail] => user@email.com
    [firstName] => user
    [lastName] => user
)

所以我认为 $ _ COOKIE 没有到期时间,是否可以使用其他一些函数?

So I think $_COOKIE don't have the expiration time, is it possible with some other function?

推荐答案

只有名称和值发送到服务器,因此没有其他Cookie数据。

Only name and value are sent to the server so no other cookie data is available.

您可以简单地重新设置cookie if你想延长其持续时间 - 这只是在响应中的几个字节更多,所以它不重要。

You can simply re-set the cookie if you want to extend its duration - that's just a few bytes more in the response so it doesn't matter at all.

这篇关于获取Cookie到期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆