Diffenece between Cookies and Session

Zend Tutorial

The main difference between a cookie and a session is that a cookie is stored on your computer, and a session is not. Although cookies have been around for many years and most people do have them enabled, there are some who do not. Cookies can also be removed by the user at any time, so don’t use them to store anything too important.

A cookie is set with the following code:setcookie(name, value, expiration)

 <?php  $Month = 2592000 + time();  //this adds 30 days to the current time  setcookie(AboutVisit, date("F jS - g:i a"), $Month); ?> 

View original post


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s