php session stats (code provided)

hutch - January 24, 2007 - 12:32
Project:System information
Version:4.7.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

A few modules use the php $_SESSION array and I wanted to display them, just to check that they were working as expected, so I added this.
Here is the code:

  // SESSION
  $header = array(array('data' => t('Session variables'), 'colspan' => '2'));
  $rows = array();
  foreach ($_SESSION as $sess_key => $sess_value) {
    if (is_array($sess_value)) {
      $rows[] = array(array('data' => $sess_key, 'class' => 'subheader', 'colspan' => '2'));
      foreach ($sess_value as $sess_key1 => $sess_value1) {
        $rows[] = array(array('data' => $sess_key1, 'class' => 'subitem'), $sess_value1);
      }
    }
    $rows[] = array($sess_key, $sess_value);
  }
  if (count($rows)) {
    $sess = array(
      '#type' => 'item',
      '#value' => theme('table', $header, $rows, array('class' => 'systeminfo'))
    );
    $output .= form_render($sess);
  }

I have also attached a patch on systeminfo.module,v 1.13.2.3

HTH

AttachmentSize
systeminfo.module_sess.patch951 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.