Cookie Variables Maxing Out Using IE6
| From: | dpgirago at mdanderson dot org | Date: | Wed, 16 Aug 2006 14:00:23 +0000 |
| Subject: | Cookie Variables Maxing Out Using IE6 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-240771@lists.php.net to get a copy of this message | ||
Does IE6 limit somehow/somewhere the number of cookie variables I can
create and store? The following code snippet successfully creates 24
cookie variables when run in FireFox, but in IE6 it is limited to 20. I
can provide the full code with HTML/Javascript if anyone wants to test for
themselves.
David
<?php
// populates a hidden form variable on the second submit
$somevar = "anything";
if (!IsSet($_POST['monitors']) || empty($_POST['monitors'])) {
$_POST['monitors'] = array();
}
/*********** Manage Monitor CheckBoxes via $_POST & $_Cookie *************/
// code in here only runs the first time the page is displayed
if ($_POST['trakVisit'] == "") {
if (IsSet($_COOKIE['cookieMeter'])) {
foreach ($_COOKIE['cookieMeter'] as $key => $value) {
if ($value == 'CHECKED') {
$checked[$key] = 'CHECKED';
}
else
$checked[$key] = "";
}
}
}
// runs on the second and subsequent submits
elseif ($_POST['trakVisit'] == "anything") {
for ($i=1; $i <= 24; $i++) {
if (in_array($i, $_POST['monitors'])) {
setcookie("cookieMeter[$i]", 'CHECKED', time()
+60*60*24*12, '/', ".mydomain.com", 1);
$checked[$i] = 'CHECKED';
}
elseif(!in_array($i, $_POST['monitors'])) {
$checked[$i] = '';
setcookie("cookieMeter[$i]", 'CHECKED', time()-3600,
'/',
".mydomain.com", 1);
}
}
}
echo "<pre>";
print_r($_COOKIE);
echo "</pre>";
?>