Hi Rik.
How can I read the values from the database (option 2) and display a html link somewhere before the page is done rendering?
I can see the values on the cache table but I don't really know how to read them. I could use the admin level 3 entry for example.

Many thanks

Comments

rdeboer’s picture

Hi stamina,

Sorry, what do you mean by "admin level 3" in the context of Session Cache API? Are you talking about "IP Geolocation Views & Maps" by any chance?
And what do you mean by "display a link before the page is done rendering?"

You can output as an info message the values currently cached (regardless of what the selected storage mechanism is) by inserting this one line code snippet in your index.php, just before the last line, menu_execute_active_handler();

  drupal_set_message('Session Cache: ' . print_r(session_cache_get('ip_geoloc'), TRUE));

Change 'ip_geoloc' to 'global_filter' if that's what you're after.

Rik

PS: if you are in fact asking about ip_geoloc, then see this excerpt form the ip_geoloc project page:

Q: For debugging purposes, can I display in a block the current user's session location data?
A: Yes. First make sure that you have the core module PHP filter enabled.
Then go Structure >> Blocks >> Add block.
Set Text format to "PHP code".
For something half readable enter in the block body something like this:

<?php 
  foreach (ip_geoloc_get_visitor_location() as $key => $value) {
    echo "$key: $value <br>";
  }
?>
Yorgg’s picture

Status: Active » Closed (fixed)

Yes, sorry I was meaning the local area variable on IP Geolocation Views & Maps :)