Drupal error when logging out - (expects true/false return)


If you are seeing this error message:
user_logout() session_destroy() expects true/false return
It is a problem with the session.inc php file not returning a boolean back from the function session_destroy

To fix:
sudo leafpad /var/www/html/forum/includes/session.inc

Do a search for (ctrl/f): function _drupal_session_destroy($sid)
under this function you need to add two return booean values:

The first will be to add TRUE to the following:
if (!drupal_save_session()) {
return TRUE;

The second will be to add return TRUE to the end of function itself.
It should look like this:
elseif (variable_get('https', FALSE)) {
_drupal_session_delete_cookie('S' . session_name(), TRUE);
return TRUE;

You may or may not need to restart apache2 after you have made the changes.
I just restarted to be on the safe side.

Now when you log out the error message should go away because you are now returning a boolean
back from the function.