Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read cookie expire date?

Status
Not open for further replies.

mrdance

Programmer
Apr 17, 2001
308
0
0
SE
Can you read when a cookie was set or when it will be expired.

thanks Henrik
 
The only way I know to do it is to set that data in the value. Set the cookie like this:

Code:
$stime = (date ("n/j/Y g:i"));
setcookie ("cookieName", "cookieValue, set=$stime, exp= set + 3600", time()+3600);

and then read the cookie with

Code:
echo $cookieName;

You'll get back something like this:
value, set=11/8/2001 8:27, exp=11/8/2001 8:27 + 3600

Hope that helps.

--Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top