Just to make it clear - $_SESSION is not global anymore in php so you can't access it from anywhere in your script unless you register it as global. And if you do, it's direct equivalent in C++ is a global variable as well.
QHash<QString,QVariant> _SESSION; // in cpp somewhere
//...
extern QHash<QString,QVariant> _SESSION; // in .h
// ...
_SESSION["x"] = "y";
QHash<QString,QVariant> _SESSION; // in cpp somewhere
//...
extern QHash<QString,QVariant> _SESSION; // in .h
// ...
_SESSION["x"] = "y";
To copy to clipboard, switch view to plain text mode
Of course it's much better to use a singleton as suggested, both in C++ and PHP.
Bookmarks