reading and checking for session variables rewritten
[mailer.git] / inc / session.php
index b0420aa12d9ef849f36d6b47ff008dc72ce9521e..306fd1cbf75cde5b984701552861d04977fd9885 100644 (file)
@@ -67,9 +67,9 @@ if (!empty($_POST['refid'])) {
 } elseif (!empty($_GET['ref'])) {
        // Set refid=ref (the referral link uses such variable)
        $GLOBALS['refid'] = SQL_ESCAPE(strip_tags($_GET['ref']));
-} elseif (!empty($_SESSION['refid'])) {
+} elseif (isSessionVariableSet('refid')) {
        // Set session refid als global
-       $GLOBALS['refid'] = bigintval($_SESSION['refid']);
+       $GLOBALS['refid'] = bigintval(get_session('refid'));
 } elseif (GET_EXT_VERSION("sql_patches") != "") {
        // Set default refid as refid in URL
        $GLOBALS['refid'] = bigintval($_CONFIG['def_refid']);
@@ -79,7 +79,7 @@ if (!empty($_POST['refid'])) {
 }
 
 // Set cookie when default refid > 0
-if (empty($_SESSION['refid']) || (!empty($GLOBALS['refid'])) || (($_SESSION['refid'] == "0") && ($_CONFIG['def_refid'] > 0))) {
+if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((get_session('refid') == "0") && ($_CONFIG['def_refid'] > 0))) {
        // Set cookie
        set_session("refid", $GLOBALS['refid']);
 }