diff --git a/boot.php b/boot.php index d2f8634e..0f4f36a4 100644 --- a/boot.php +++ b/boot.php @@ -1,5 +1,7 @@ set_baseurl(get_config('system', 'url')); diff --git a/include/session.php b/include/session.php index e51dbc1b..a125679f 100644 --- a/include/session.php +++ b/include/session.php @@ -30,10 +30,14 @@ function ref_session_write($id, $data) { global $session_exists, $session_expire; - if (!$id || !$data) { + if (!$id) { return false; } + if (!$data) { + return true; + } + $expire = time() + $session_expire; $default_expire = time() + 300; @@ -65,7 +69,7 @@ function ref_session_gc($expire) { q("DELETE FROM `session` WHERE `expire` < %d", dbesc(time())); q("OPTIMIZE TABLE `sess_data`"); - + return true; } diff --git a/index.php b/index.php index 082f0c0e..07ddb75a 100644 --- a/index.php +++ b/index.php @@ -24,8 +24,6 @@ unset($db_host, $db_user, $db_pass, $db_data); $a->init_pagehead(); $a->page['aside'] = '
Your friends. Your web.
'; -require_once 'session.php'; - session_start(); if ((x($_SESSION, 'authenticated')) || (x($_POST, 'auth-params')) || ($a->module === 'login')) {