} // END - if
// Unset/set session variables
-function setSession ($var, $value) {
+function setSession (string $var, $value) {
// Abort in CSS mode here
if (isCssOutputMode()) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Is CSS mode:' . $var . '=' . $value);
} // END - if
// Trim value and session variable
- $var = trim(secureString($var));
+ $var = trim(secureString($var));
// Is the value no array?
- if (!is_array($value)) {
+ if (!is_array($value) && !is_null($value)) {
// Then trim it
$value = trim($value);
} // END - if
}
// Check whether a session variable is set
-function isSessionVariableSet ($var) {
+function isSessionVariableSet (string $var) {
// Warning: DO NOT call logDebugMessage() from here, this will cause an endless loop
return (isset($_SESSION[$var]));
}
// Returns whether the value of the session variable or NULL if not set
-function getSession ($var) {
+function getSession (string $var) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'var=' . $var . ' - CALLED!');
// Default is not found ;-)
$value = NULL;
}
// Destroy user session
-function destroyMemberSession ($destroy = FALSE) {
+function destroyMemberSession (bool $destroy = FALSE) {
// Reset userid
initMemberId();
}
// Destroys the admin session
-function destroyAdminSession ($destroy = FALSE) {
+function destroyAdminSession (bool $destroy = FALSE) {
// Kill maybe existing session variables including array elements
setAdminId(0);
setAdminMd5('');
}
// Checks whether all given session data is set
-function isSessionDataSet ($sessionData) {
+function isSessionDataSet (array $sessionData) {
// Default is set
$isset = TRUE;
}
// [EOF]
-?>