Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

What operation we can perform  with Cookie?Explain it?
We can create the cookie,retrieve heir value and destroy them.
1.Creating a cookie: Using setcookie() function we can create a cookie.
Example:
<?php 
setcookie("client", "Abhi", time()+3600);
?>
<html>
.....
.....
2.Retrieve cookie value: Using $_COOKIE we can retrieve the cookie value.
Example:
<?php
// Print a cookie value
echo $_COOKIE["client"];
// Using them we show the all cookie values
print_r($_COOKIE);
?>
3.Destroy the cookie: Keep one thing in mind when you destroying cookie that its expiry date should has been gone.
Example:
<?php 
// set the expiration date to one hour ago
setcookie("client", "", time()-3600);
?>