Re: [PHP] Cookie Variables Maxing Out Using IE6

2006-08-18 Thread Richard Lynch
Set your session time out to, oh, 2 years or less (as in the spec,
they are gonna ignore you if you try more than 2 years).

You could even set *ONE* cookie with all the values serialized in an
array, and probably stay under the 4K limit.

Then you get people like me who, if a cookie value looks TOO funky,
I'll reject it, on the assumption that you are exposing my personal
info to your advertising sites for user-tracking.

Buh-bye.

Try to think about your cookies from the perspective of a paranoid
media-believing moron.

Like that movie with Mel Gibson, sort of...

Because SOME of your visitors are that weird, self included.

:-)

You can store a Cookie to ID me with something I know is "me", and
then you know who I am for the next 2 years.  That should be good
enough.

Read the PHP session pages, and the setcookie page, and work out
what's best for you, with the paranoid user visitor mentality above.

On Thu, August 17, 2006 9:20 am, [EMAIL PROTECTED] wrote:
>
> On Wed, August 16, 2006 9:00 am, [EMAIL PROTECTED] wrote:
>> Does IE6 limit somehow/somewhere the number of cookie variables I
>> can
>> create and store?
>
> Richard Lynch responded:
>> Yes.
>>
>> Read the Cookie spec.
>>
>> There's no need for any site to ever send more than ONE Cookie
>> anyway.
>>
>> Just use session_start() and you can store all the stuff in
>> $_SESSION
>> and it's all tied to the one Cookie.
>>
>> Users like me who set the browser to prompt for Cookies will often
>> LEAVE a site that is being stupid and sending too many cookies,
>> unless
>> we really really really need your content, which is unlikely.
>
> So you're calling my app "stupid", Richard?? 
>
> To clarify, the app is for a small group of known users on an
> intranet, and
> yes, they really really need the content. There are 24 check boxes,
> and
> each selection triggers a graphical display of radiation levels in a
> specific area over the last hour. Since the active areas - 12 to 15
> usually
> -  don't change all that much over time, I thought it would make sense
> to
> have the app "remember" which boxes had been checked at last launch. I
> didn't like the idea of using cookies, so I actually have a database
> solution in place. But I've not dealt much with cookies, and I had
> some
> time and tried to use them to solve the problem. That's when I ran
> into the
> 20 cookie limit with IE (Having just read the spec, I'm surprised that
> Microsoft has actually followed it).
>
> Unless there's something basic about $_SESSION variables I've missed,
> I
> don't believe they would work here. I need to track and remember which
> boxes are checked between sessions, not within a single session.
> Someone
> please correct me if I'm mistaken.
>
> Thanks again to Adam Zey for suggesting I serialize the cookie data.
> That
> solved the problem.
>
> David
>
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cookie Variables Maxing Out Using IE6

2006-08-17 Thread Adam Zey

[EMAIL PROTECTED] wrote:

There are 24 check boxes, and
each selection triggers a graphical display of radiation levels in a
specific area over the last hour.

David


So, if the user deletes the cookie, they grow a third eye? At last, a 
viable method of preventing privacy nazis from deleting my cookies!


Sorry, I couldn't resist ;)

Regards, Adam Zey.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cookie Variables Maxing Out Using IE6

2006-08-17 Thread dpgirago

On Wed, August 16, 2006 9:00 am, [EMAIL PROTECTED] wrote:
> Does IE6 limit somehow/somewhere the number of cookie variables I can
> create and store?

Richard Lynch responded:
> Yes.
>
> Read the Cookie spec.
>
> There's no need for any site to ever send more than ONE Cookie anyway.
>
> Just use session_start() and you can store all the stuff in $_SESSION
> and it's all tied to the one Cookie.
>
> Users like me who set the browser to prompt for Cookies will often
> LEAVE a site that is being stupid and sending too many cookies, unless
> we really really really need your content, which is unlikely.

So you're calling my app "stupid", Richard?? 

To clarify, the app is for a small group of known users on an intranet, and
yes, they really really need the content. There are 24 check boxes, and
each selection triggers a graphical display of radiation levels in a
specific area over the last hour. Since the active areas - 12 to 15 usually
-  don't change all that much over time, I thought it would make sense to
have the app "remember" which boxes had been checked at last launch. I
didn't like the idea of using cookies, so I actually have a database
solution in place. But I've not dealt much with cookies, and I had some
time and tried to use them to solve the problem. That's when I ran into the
20 cookie limit with IE (Having just read the spec, I'm surprised that
Microsoft has actually followed it).

Unless there's something basic about $_SESSION variables I've missed, I
don't believe they would work here. I need to track and remember which
boxes are checked between sessions, not within a single session. Someone
please correct me if I'm mistaken.

Thanks again to Adam Zey for suggesting I serialize the cookie data. That
solved the problem.

David

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cookie Variables Maxing Out Using IE6

2006-08-16 Thread Richard Lynch
On Wed, August 16, 2006 9:00 am, [EMAIL PROTECTED] wrote:
> Does IE6 limit somehow/somewhere the number of cookie variables I can
> create and store?

Yes.

Read the Cookie spec.

There's no need for any site to ever send more than ONE Cookie anyway.

Just use session_start() and you can store all the stuff in $_SESSION
and it's all tied to the one Cookie.

Users like me who set the browser to prompt for Cookies will often
LEAVE a site that is being stupid and sending too many cookies, unless
we really really really need your content, which is unlikely.

You can Google and find the Cookie spec on Netscape's site -- It's
very easy to digest, no pun intended, and a very well thought out
spec.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Cookie Variables Maxing Out Using IE6

2006-08-16 Thread dpgirago

> On Wed, August 16, 2006 9:00 am, [EMAIL PROTECTED] wrote:
>> Does IE6 limit somehow/somewhere the number of cookie variables I can
>> create and store?

Richard Lynch wrote:
> Yes.
>
> Read the Cookie spec.
>
> There's no need for any site to ever send more than ONE Cookie anyway.
>
> Just use session_start() and you can store all the stuff in $_SESSION
> and it's all tied to the one Cookie.
>
> Users like me who set the browser to prompt for Cookies will often
> LEAVE a site that is being stupid and sending too many cookies, unless
> we really really really need your content, which is unlikely.
>
> You can Google and find the Cookie spec on Netscape's site -- It's
> very easy to digest, no pun intended, and a very well thought out
> spec.

Thanks, Richard. I'll take a look.

David

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Cookie Variables Maxing Out Using IE6

2006-08-16 Thread dpgirago
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

 $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 "";
print_r($_COOKIE);
echo "";

?>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php