= '5.3.1') { // session_unregister() is deprecated as of 5.3.1 return true; } else { // PHP version < 5.3.1 return session_unregister($var); } } elseif (('' . $value . '' != '') && (!isSessionVariableSet($var))) { // Set session //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'SET:' . $var . '=' . $value); $GLOBALS['_SESSION'][$var] = $value; if (phpversion() >= '5.3.1') { // session_unregister() is deprecated as of 5.3.1 return true; } else { // PHP version < 5.3.1 return session_register($var); } } elseif (!empty($value)) { // Update session //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'UPDATE:' . $var . '=' . $value); $GLOBALS['_SESSION'][$var] = $value; return true; } // Ignored (but valid) //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'IGNORED:' . $var . '=' . $value); return true; } // Check wether a session variable is set function isSessionVariableSet ($var) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'var=' . $var . ' set in session'); return (isset($GLOBALS['_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? if (isSessionVariableSet($var)) { // Then get it secured! $value = SQL_ESCAPE($GLOBALS['_SESSION'][$var]); } // END - if // Return the value //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $var . '=' . $value); return $value; } // Destroy user session function destroyMemberSession () { // Reset userid initMemberId(); // 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 setAdminId(0); setAdminMd5(''); setAdminLast(''); // Destroy session if requested and return status if ($destroy === true) { return session_destroy(); } // END - if // All fine if we shall not really destroy the session return true; } // [EOF] ?>