Having this problem when accessing the site the first time.
Error thrown is:
Notice: Trying to get property of non-object in c:\Inetpub\wwwroot\drupal-4.5.0\includes\session.inc on line 29
This casues headers to be sent and then I have all sorts of issues (expected) with cookies and the like.
I've debugged to:
db_query("INSERT INTO {sessions} (uid, sid, hostname, timestamp) values(%d, '%s', '%s', %d)", $user->uid, $key, $_SERVER["REMOTE_ADDR"], time());