You are here

function fb_flush_caches in Drupal for Facebook 7.4

Implements hook_flush_caches().

fb_graph does something unusual in that it caches some items in the local session. These end up not flushed when caches are cleared. Probably, it would be best to stop that practice and make a database table devoted to the session caches (@todo). Until that is done, this hook at least lets admins flush their own session cache.

File

./fb.module, line 1503

Code

function fb_flush_caches() {

  // By unsetting this portion of the session, queries to fb_graph('me') will be flushed.
  unset($_SESSION['fb']);
  return array();

  // Without this, flush caches breaks!
}