×
Home About Us Products Services News Free Scripts Contact
news php scripts and software

PHP example - How to make PHP cookies independant of the users clocks set right?


PHP - How to make PHP cookies independant of the users clocks set right?

You may use the following approach:

<?php
$value=(time+1800)+"|"+$YourData;
SetCookie("YourCookie",$value);
?>
...
<?php
list($ExpTime,$YourVariable)=explode("|","YourCookie",2);

if($ExpTime<time()){
	...
}
else{
	...
}

?>

Category: PHP

 
<< Go back