From: brunoccast Date: Tue, 4 Jun 2019 00:02:46 +0000 (+0100) Subject: Cleanup and documentation of common_ensure_session X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=061e7891e9c690b8aaa1a14f379503dbf26019e4;p=quix0rs-gnu-social.git Cleanup and documentation of common_ensure_session - Remove redundant branch - Remove error suppression of session_start() --- diff --git a/lib/util.php b/lib/util.php index 1668634020..f2e09daa93 100644 --- a/lib/util.php +++ b/lib/util.php @@ -275,12 +275,12 @@ 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_set_save_handler(new InternalSessionHandler(), true); @@ -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)) {