Location: PHPKode > projects > Community Learning Network > cln/lib/CLN/interfaces/SessionVars.php
<?php 
/*
 * Session Variables
 *
 * Copyright (c) 2003-4 St. Christopher House
 *
 * Developed by The Working Group Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.  
 *
 * @version $Id: SessionVars.php,v 1.7 2004/08/10 02:42:31 cbooth7575 Exp $
 *
 */

define('CLN_FILE_BASE', '../../../');
$PAGETYPE = 'Admin';
include(CLN_FILE_BASE . 'index.php');

/* page specific code */
if(isset($_GET['removeSession'])) {
  if(session_destroy()) {
    session_unregister("User");
  }
  
  clnRedirect($_SERVER['PHP_SELF']);
  exit;
}

/* page specific code */
if(isset($_GET['removeObject'])) {
  session_unregister($_GET['removeObject']);
  
  clnRedirect($_SERVER['PHP_SELF']);
  exit;
}

echo "Session size: ".exec("du -s /tmp/sess_".session_id()."|awk '{ print $1 }'") . 'K';

?>
<style type="text/css">
<!--
}
pre {
	font-size: 10px;
}
h4 {
	font-size: 11px;
	font-weight: bold;
	margin-top: 0;
}
-->
</style>
<p>Sid: <?php echo session_id(); ?> &nbsp; &nbsp; <a href="<?php echo $_SERVER['PHP_SELF']; ?>?removeSession=1">remove</a></p>
<pre>
<?php

foreach($_SESSION as $name => $session) {
	//print "<a href=\"".$_SERVER['PHP_SELF']."?removeObject=".$session."\">remove object below</a>";
	print "<b>".$name."</b> &nbsp; &nbsp; <a href=\"".$_SERVER['PHP_SELF']."?removeObject=".$name."\">remove</a><br />";
	print_r($session);
}

?>
</pre>
Return current item: Community Learning Network