Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 7 Session Handling #3230

Merged
merged 2 commits into from
Jan 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions Sources/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function sessionWrite($session_id, $data)
array('session_id')
);

return $result;
return ($smcFunc['db_affected_rows']() == 0 ? false : true);
}

/**
Expand All @@ -194,13 +194,15 @@ function sessionDestroy($session_id)
return false;

// Just delete the row...
return $smcFunc['db_query']('', '
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}sessions
WHERE session_id = {string:session_id}',
array(
'session_id' => $session_id,
)
);

return true;
}

/**
Expand All @@ -219,13 +221,15 @@ function sessionGC($max_lifetime)
$max_lifetime = max($modSettings['databaseSession_lifetime'], 60);

// Clean up after yerself ;).
return $smcFunc['db_query']('', '
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}sessions
WHERE last_update < {int:last_update}',
array(
'last_update' => time() - $max_lifetime,
)
);

return ($smcFunc['db_affected_rows']() == 0 ? false : true);
}

?>