Today I upgraded a client to the latest version of Magento (18.104.22.168). Â Upon finishing the FTP of the new version, I could see the front end of the website with no problem. Â The backend, however, would not work becuase of this error:
Fatal error: Call to a member function getUsername() on a non-object in /app/design/adminhtml/default/default/template/page/header.phtml
At first I thought it was going to be a long, time consuming error, but turns out the fix is really easy.
The easiest way to fix it is to rename your /var/ folder to /var_old/ and then build a new /var/ folder. Â This basically wipes out all cache, sessions, etc.
There may be cases where you can get away with just deleting all files from inside Â /var/cache and var/session as well.