php and register_globals

As a part of the Personal Messenger, php 5 has been choosen to do the heavy lifting of the web UI. Using the window management system requires session serialization of the Window Manager object.

With PHP 4 it was as simple as

session_start();
$winman = new WindowManager();
session_register("pmstarted");
$_SESSION["winman"] = $winman;

unfortunately, with PHP 5, for some reason the code changes to

session_start();
$winman = new WindowManager();
session_register("pmstarted");
$_SESSION["winman"] = serialize($winman);

in addition, if register_globals setting is On, the $_SESSION loses the winman entry altogether.

Comments

Popular Posts