]> git.mxchange.org Git - mailer.git/blobdiff - inc/session-functions.php
inc/session.php is no longer needed.
[mailer.git] / inc / session-functions.php
index 954d233c3da5dbf2103694d1588268cea44f26b2..8f2ec9e9ec6c8da9a6fa731dff6309d6f74024cf 100644 (file)
@@ -184,5 +184,28 @@ function isSessionDataSet ($sessionData) {
        return $isset;
 }
 
+// Initializes session
+function initSession () {
+       //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'CALLED!');
+
+       // Is ext-sql_patches there and newer?
+       if (isExtensionInstalledAndNewer('sql_patches', '0.5.3')) {
+               // Set session save path if set
+               if ((isConfigEntrySet('session_save_path')) && (getConfig('session_save_path') != '')) {
+                       // Please make sure this valid!
+                       session_save_path(getConfig('session_save_path'));
+               } // END - if
+       } // END - if
+
+       // Is a session id there?
+       if (!isValidSession()) {
+               // Start the session
+               $GLOBALS['valid_session']  = session_start();
+               $GLOBALS['isValidSession'] = TRUE;
+       } // END - if
+
+       //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'EXIT!');
+}
+
 // [EOF]
 ?>