Your Ad Here

Saturday, November 7, 2009

How to set cookies in PHP?

setcookie('variable','value','time');
variable - name of the cookie variable
value - value of the cookie variable
time - expiry time

Example: setcookie('Test',$i,time()+3600);
Test - cookie variable name
$i - value of the variable 'Test'
time()+3600 - denotes that the cookie will expire after an one hour

No comments:

Post a Comment

Your Ad Here