Tag: cookies in php

What is difference between Persistent Cookie and Temporary cookies?

January 10, 2010 | Filed Under PHP | 2 Comments

Temporary cookies :

By Default Temporary cookie is active which is store in browser memory, live until browser  is closed.

Persistent Cookie: persistent cookie is a cookie which is stored in a cookie file permanently on the browser’s computer.

Which is live for a time period defines by programmer in the script.

Example:

<?php

$value = ‘value’;
setcookie("testcookie", $value, time()+3600); /* expire in 1 hour */

// Where 3600 count in 60*60*1 [second*minute*hour]

?>

Article written by admin

© PHPInterviewQuestion.com 2009 - 2012

eXTReMe Tracker