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
6 changed files with 8 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue