After having a bit of pain with sessions and a legacy application I am 'wrapping' into a Drupal skin (full module here if you are interested) I've finally narrowed down one last problem.
A problem that's been crippling the site.
We've been unable to enable caching for Drupal as it caches too hard for anonymous users. Simply, some of the add-on functionality for a few of the pages is dynamic, the pages need to look different to different, yet anonymous, folk.
Currently, I can't even do something as simple as
print "the time is ". time();
and have it work
Never mind :
"Hello anonymous, you appear to have logged in from [uganda] and are using [Firefox]
The actual problem is an order of magnitude greater, but the symptom is the same. And running a high-traffic site with no Drupal cache is killing me of course.
I just need to be able to set a flag, somewhere, to instruct the page_set_cache cache to NOT bother remembering this, it'll never be used again.
Right now, I've tweaked common.inc to include
function page_set_cache() {
global $user, $base_root;
// CORE HACK TO AVOID WRAPPER.MODULE CACHING DYNAMIC PAGES
global $NEVER_CACHE_THIS_PAGE;
if( $NEVER_CACHE_THIS_PAGE ) { return; }
...