Click to See Complete Forum and Search --> : cookies


k0r54
03-24-2005, 11:03 AM
Hi,

can any1 tell me how a cookie actually works and the best way to creatre one.

Thanks
Adam

NogDog
03-24-2005, 11:19 AM
http://us2.php.net/manual/en/function.setcookie.php
http://us2.php.net/manual/en/reserved.variables.php#reserved.variables.cookies

A related tutorial:
http://www.zend.com/zend/tut/feedback.php

k0r54
03-24-2005, 11:24 AM
if i dont want the cookie to expire how can i stop is?? as no expiry date deletes it with the session

NogDog
03-24-2005, 11:44 AM
Originally posted by k0r54
if i dont want the cookie to expire how can i stop is?? as no expiry date deletes it with the session
I don't know of a way to have it never expire, but you can give it a really long expiration time. For example, two years would be:

setcookie("mycookie", "This is the value", time()+60*60*24*365*2);