Get cookie expiration

前端 未结 3 484
别那么骄傲
别那么骄傲 2021-01-21 21:56

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

Array
(
    [PHPSESSID] => 0afef6bac83a7db8abd9f87b         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-21 22:41

    no, there is no way.
    Browser uses cookie parameters (path, expiration etc) only to determine to send a cookie or not, but none of these parameters being sent back to server.

    don't think of a cookie as of a $_SESSON array member but as an HTTP header. That's always helps.

提交回复
热议问题