Does anyone have any opinions or concerns on this issue?
I've attached a patch for it, in case it is something you would be
interested in committing.
On Fri, 2007-05-11 at 22:53 +0000, "Matt Ryan" wrote:
> Hi,
>
>
> I want to ask a question about a section in header.php where there is
> a cookie being set which remembers the grid stack. Here is the code
> in question:
>
>
> if ($initgrid or $gridwalk)
>
> {
>
> # Use cookie so we dont have to pass gridstack around within
> this site.
>
> # Cookie values are automatically urlencoded. Expires in a day.
>
> setcookie("gs", $gridstack_str, time() + 86400);
>
> }
>
>
>
> My client application that connects to the ganglia web UI opens
> multiple browser sessions from the same client. I am seeing the size
> of the cookie grow exponentially with each invocation until my
> requests get rejected because the cookie is too large. I'm seeing the
> same cookie set over and over with different expiration times.
>
> I don't have control over how the client manages cookies (this is
> handled within the library). I'm wondering about a change to the code
> so that the cookie is only set if it hasn't already been set before,
> like this:
>
>
> if ($initgrid or $gridwalk)
>
> {
>
> # Use cookie so we dont have to pass gridstack around within
> this site.
>
> # Cookie values are automatically urlencoded. Expires in a day.
>
> $gscookie = $_COOKIE["gs"];
>
> if (! isset($gscookie))
>
> setcookie("gs", $gridstack_str, time() + 86400);
>
> }
>
>
>
> In this case, header.php looks for the cookie first, then only sets it
> if it wasn't set before.
>
>
> This solves my problem of the growing cookie size. But I don't know
> what the other ramifications of this change might be. Do you have any
> concerns or feedback?
>
>
> Matt Ryan
> Senior Software Engineer
>
> Novell, Inc.
> Software for the Open Enterprise
> www.novell.com/open
>
>
>
>
--- header.php 2007-05-16 12:08:27.000000000 -0600
+++ header.php.new 2007-05-16 12:09:43.000000000 -0600
@@ -53,7 +53,9 @@
{
# Use cookie so we dont have to pass gridstack around within this site.
# Cookie values are automatically urlencoded. Expires in a day.
- setcookie("gs", $gridstack_str, time() + 86400);
+ $gscookie = $_COOKIE["gs"];
+ if (! isset($gscookie))
+ setcookie("gs", $gridstack_str, time() + 86400);
}
# Invariant: back pointer is second-to-last element of gridstack. Grid stack
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers