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]

?>

Comments

2 Responses to “What is difference between Persistent Cookie and Temporary cookies?”

  1. Amiable post and this post helped me alot in my college assignement. Gratefulness you as your information.

  2. Well I agree but I about the brief should secure more info then it has.

© PHPInterviewQuestion.com 2009 - 2012

eXTReMe Tracker