note 47574 deleted from function.session-register by cmb
| From: | cmb@php.net | Date: | Wed, 24 Feb 2021 12:11:01 +0000 |
| Subject: | note 47574 deleted from function.session-register by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-219291@lists.php.net to get a copy of this message | ||
Note Submitter: mikej
----
I've noticed that if you try to assign a value to a session variable with a numeric name, the
variable will not exist in future sessions.
For example, if you do something like:
session_start();
$_SESSION['14'] = "blah";
print_r($_SESSION);
It'll display:
Array ( [14] => "blah" )
But if on another page (with same session) you try
session_start();
print_r($_SESSION);
$_SESSION[14] will no longer exist.
Maybe everyone else already knows this, but I didn't realize it until messing around with a
broken script for quite a while.