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
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-developers