]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/util.php
Cleanup and documentation of common_ensure_session
[quix0rs-gnu-social.git] / lib / util.php
index 9466d9c0524457afd1c244a9bddb7e815ee49275..f2e09daa936fd66801cda26371734bb144297c15 100644 (file)
@@ -275,15 +275,15 @@ function common_have_session()
     return (0 != strcmp(session_id(), ''));
 }
 
+/**
+ * Make sure session is started and handled by
+ * the correct handler.
+ */
 function common_ensure_session()
 {
-    $c = null;
-    if (array_key_exists(session_name(), $_COOKIE)) {
-        $c = $_COOKIE[session_name()];
-    }
     if (!common_have_session()) {
         if (common_config('sessions', 'handle')) {
-            Session::setSaveHandler();
+            session_set_save_handler(new InternalSessionHandler(), true);
         }
         if (array_key_exists(session_name(), $_GET)) {
             $id = $_GET[session_name()];
@@ -293,7 +293,7 @@ function common_ensure_session()
         if (isset($id)) {
             session_id($id);
         }
-        @session_start();
+        session_start();
         if (!isset($_SESSION['started'])) {
             $_SESSION['started'] = time();
             if (!empty($id)) {