Every time I try to install module, or clear the cache, or run update.php I get the 500 Internal Server Error page, and in the report log the following:
"Trying to get property of non-object in _drupal_session_write() (line 178 of C:\Data\Production\drupalConnection\includes\session.inc)."
That message is written to the log every time one of those actions is attempted. The code around line 178 of that session.inc is:
"if ($is_changed || !isset($user->timestamp) || REQUEST_TIME - $user->timestamp > variable_get('session_write_interval', 180)) {
// Either ssid or sid or both will be added from $key below.
$fields = array(
'uid' => $user->uid,
'cache' => isset($user->cache) ? $user->cache : 0,
'hostname' => ip_address(),
'session' => $value,
'timestamp' => REQUEST_TIME,
);
"
This is on our production server. The report log shows that error back to about the time of the 7.23 core update, and not before. The odd things though, the 7.23 core is also installed on our Beta server, which doesn't have the problem at all.
Any ideas what might be causing this?
Comments
Comment #1
marcingy commentedComment #2
roberto.s commentedI've experienced a similar problem. The problem was, in one of the functions I used a global variable
global $userand later in that same function the variable $user got overwritten:
<del>$user = 'something';</del>Using different variable name solved the problem. Hope this helps.
Comment #3
mohmmadalabed commented#2 works!