+ return TRUE;
+}
+
+// Destroys session and resets some "caches"
+function destroySession () {
+ // Unset "cache"
+ unset($GLOBALS['isSessionValid']);
+
+ // Destroy session
+ return session_destroy();
+}
+
+// Checks whether the session is valid
+function isSessionValid () {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Then determine it
+ $GLOBALS[__FUNCTION__] = ((isset($GLOBALS['valid_session'])) && ($GLOBALS['valid_session'] === TRUE) && (isset($_COOKIE[session_name()])));
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];