note 90084 added to function.setcookie
| From: | danatreverb-marketingdotcom at osu1 dot php dot net | Date: | Sun, 05 Apr 2009 18:49:24 +0000 |
| Subject: | note 90084 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152838@lists.php.net to get a copy of this message | ||
Consider adding a version number to your cookie string. That way if your site gets an upgrade and
the contents of your cookie change then it won't create (as big of) a headache for old users.
<?php
$foo=unserialize($_COOKIE['remember_me']);
if($foo['version']==1) {
// original cookie. Ignore it? Process it differently?
old_and_busted($foo['data']);
} else if($foo['version']==2) {
// new cookie, proceed as normal
new_hotness($foo['data']);
}
?>
----
Server IP: 216.235.13.26
Probable Submitter: 24.80.224.59
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- https://master.php.net/note/edit/90084
Del: integrated -- https://master.php.net/note/delete/90084/integrated
Del: useless -- https://master.php.net/note/delete/90084/useless
Del: bad code -- https://master.php.net/note/delete/90084/bad+code
Del: spam -- https://master.php.net/note/delete/90084/spam
Del: non-english -- https://master.php.net/note/delete/90084/non-english
Del: in docs -- https://master.php.net/note/delete/90084/in+docs
Del: other reasons-- https://master.php.net/note/delete/90084
Reject -- https://master.php.net/note/reject/90084
Search -- https://master.php.net/manage/user-notes.php