note 28130 deleted from function.serialize by sniper
| From: | sniper@php.net | Date: | Tue, 23 Sep 2003 22:38:12 +0000 |
| Subject: | note 28130 deleted from function.serialize by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57003@lists.php.net to get a copy of this message | ||
Note Submitter: darryly@darryly@sbcglobal.net
----
if you are trying to save an object as a cookie, you must first serialize it then urlencode it.
to read the cookie, urldecode it then unserialize.
For Example:
SETTING THE COOKIE OBJECT
setcookie("cookie_name", urlencode(serialize($theobject)), $cookielife);
READING THE COOKIE OBJECT
$theobject = unserialize(urldecode($_COOKIE["cookie_name"]));