\n"; unset($_SESSION[$var]); return session_unregister($var); } elseif (("".$value."" != '') && (!isSessionVariableSet($var))) { // Set session //* DEBUG: */ echo "SET:".$var.'='.$value."
\n"; $_SESSION[$var] = $value; return session_register($var); } elseif (!empty($value)) { // Update session //* DEBUG: */ echo "UPDATE:".$var.'='.$value."
\n"; $_SESSION[$var] = $value; return true; } // Ignored (but valid) //* DEBUG: */ echo "IGNORED:".$var.'='.$value."
\n"; return true; } // Check wether a session variable is set function isSessionVariableSet ($var) { //* DEBUG: */ print __FUNCTION__."(".__LINE__."):var={$var}
\n"; return (isset($_SESSION[$var])); } // Returns wether the value of the session variable or NULL if not set function getSession ($var) { // Default is not found! ;-) $value = null; // Is the variable there or cached values? if (isset($GLOBALS['cache_array']['session'][$var])) { // Get cached value (skips a lot SQL_ESCAPE() calles! //* DEBUG: */ print __FUNCTION__."(".__LINE__."): ".$var."-CACHE!
\n"; $value = $GLOBALS['cache_array']['session'][$var]; } elseif (isSessionVariableSet($var)) { // Then get it secured! //* DEBUG: */ print __FUNCTION__."(".__LINE__."): ".$var."-RESOLVE!
\n"; $value = SQL_ESCAPE($_SESSION[$var]); // Cache the value $GLOBALS['cache_array']['session'][$var] = $value; } // END - if // Return the value return $value; } // Destroy user session function destroyUserSession () { // Reset userid setUserId(0); // Remove all user data from session return ((setSession('userid', '')) && (setSession('u_hash', ''))); } // Destroys the admin session function destroyAdminSession ($destroy = true) { // Kill maybe existing session variables including array elements setSession('admin_login', ''); setSession('admin_md5' , ''); setSession('admin_last' , ''); setSession('admin_to' , ''); // Destroy session and return status if ($destroy) { return session_destroy(); } // END - if // All fine if we shall not really destroy the session return true; } // [EOF] ?>