Home Tutorial Php Examples PHP Get Cookie

 
 

Share on Google+Share on Google+
PHP Get Cookie
Posted on: October 9, 2009 at 12:00 AM
Advertisement
PHP Get Cookie tutorial provides an example by which you can check the attributes of Cookie

PHP Get Cookie

The Cookies can be used to store identifiable information about a user on their computer so that the website can use or pick up on it later, even after your computer has been turned off, and you may continue from where you started. To get the information of Cookie  you can use the following example

(To know Cookie in details please visit our web page http://www.roseindia.net/software-tutorials/detail/16640):

Code:

<?php

//Calculate 60 days in the future

//seconds * minutes * hours * days + current time

$inTwoMonths = 60 * 60 * 24 * 60 + time();

setcookie('lastVisit', date("G:i - m/d/y"), $inTwoMonths);

f(isset($_COOKIE['lastVisit']))

$visit = $_COOKIE['lastVisit'];

else

echo "You've got some cookies!";

cho "Your last visit was - ". $visit;

?>

Output:

Your last visit was - 9:05 - 09/12/09

Advertisement

Related Tags for PHP Get Cookie :


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: October 9, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com