Fix "PHP Warning: session_write_close(): Failed to write session data (user)" errors
- Changed returning true when there's a session ID but no session data in ref_session_write() - Moved session.php requires around
This commit is contained in:
parent
9633d3393f
commit
4601c4bd8a
2
boot.php
2
boot.php
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
require_once 'include/session.php';
|
||||
|
||||
require_once 'vendor/autoload.php';
|
||||
|
||||
set_time_limit(0);
|
||||
|
|
|
@ -15,7 +15,6 @@ $db = new dba($db_host, $db_user, $db_pass, $db_data);
|
|||
|
||||
unset($db_host, $db_user, $db_pass, $db_data);
|
||||
|
||||
require_once 'session.php';
|
||||
require_once 'datetime.php';
|
||||
|
||||
if ($argc < 3) {
|
||||
|
|
|
@ -15,7 +15,6 @@ $db = new dba($db_host, $db_user, $db_pass, $db_data);
|
|||
|
||||
unset($db_host, $db_user, $db_pass, $db_data);
|
||||
|
||||
require_once 'session.php';
|
||||
require_once 'datetime.php';
|
||||
require_once 'simplepie/simplepie.inc';
|
||||
require_once 'include/items.php';
|
||||
|
|
|
@ -14,7 +14,6 @@ $db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
|
|||
|
||||
unset($db_host, $db_user, $db_pass, $db_data);
|
||||
|
||||
require_once 'session.php';
|
||||
require_once 'datetime.php';
|
||||
|
||||
$a->set_baseurl(get_config('system', 'url'));
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,6 @@ unset($db_host, $db_user, $db_pass, $db_data);
|
|||
$a->init_pagehead();
|
||||
$a->page['aside'] = '<div id="logo"><img src="images/friendica-32.png" alt="friendica logo" /> <a href="http://friendica.com">Friendica</a></div><div id="slogan">Your friends. Your web.</div>';
|
||||
|
||||
require_once 'session.php';
|
||||
|
||||
session_start();
|
||||
|
||||
if ((x($_SESSION, 'authenticated')) || (x($_POST, 'auth-params')) || ($a->module === 'login')) {
|
||||
|
|
Loading…
Reference in a new issue