PHP 4.0 Bug #6446: Session Array Variable Append
| From: | nathan at cjhunter dot com | Date: | Wed, 30 Aug 2000 19:12:59 +0000 |
| Subject: | PHP 4.0 Bug #6446: Session Array Variable Append | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-31296@lists.php.net to get a copy of this message | ||
From: nathan@cjhunter.com
Operating system: Linux 2.0.36
PHP version: 4.0.1pl2
PHP Bug Type: Feature/Change Request
Bug description: Session Array Variable Append
When using php sessions with a registered array variable; if that variable is set before the call to
session_start() is made, instead of overwriting the variable with the stored session value I request
php check if that variable is already set and do an array_merge() on the two arrays. This is useful
for accumulating key and value pairs.
Example
first..
<?
$input = array();
session_register("input");
?>
then..
<?
// Upon form submission at session_start() the input variable is overwritten
session_start();
var_dump($input);
?>
<form>
<input type="text" name="input[<?echo time()?>]">
<input type="submit">
</form>