Login error: Could not update .ICEauthority file

Encountering the following error message when logging in to Ubuntu (or another Linux)?

Could not update ICEauthority file /home/user-name/.ICEauthority
Could not update ICEauthority file /home/user-name/.ICEauthority

I had that on my Mom's machine, and it drove us nuts. I tried every trick I could find on the Internet and a bunch more of my own.

Finally found the solution, and it was embarrassingly simple... No auto-login is allowed if you have an encrypted home folder. Makes sense, but if you forget it's encrypted and want a quicker login, you're in for trouble.

There were 3 error messages that popped up; here are the second and third ones:

Number 2:

There is a problem with the configuration server. (/usr/lib/libgconf2-4/gconf-sanity-check-2 exited with status 256)
There is a problem with the configuration server.
(/usr/lib/libgconf2-4/gconf-sanity-check-2 exited with status 256)

Number 3:

Nautilus could not create the following required folders
Nautilus could not create the following required folders: /home/user-name/Desktop, /home/user-name/.nautilus

The solution was to click through these errors. Then, as no desktop comes up, press Alt+F2 (that's the Alt key and the top-row's F2 key at the same time). This will bring up a dialogue box asking what programme you'd like to run:

Alt+F2 to Run Application, choose /bin/bash
Alt+F2 to Run Application, type /bin/bash.

Now you should have a terminal window running. Restart the Gnome Display Manager (desktop, etc.) by typing:
sudo /etc/init.d/gdm restart and give your password when prompted. You should have a desktop afterward.

This is the embarrassing part: I'd forgotten that I had changed user settings to login without password prompt. Fix that by clicking System -> Administration -> Users and Groups.

Unselect the "Don't ask for password on login." option.

Don't ask for password on login
Don't ask for password on login.

If you have also edited a file on your system to automatically log you in, and you have an encrypted home directory, you need to edit the file you probably edited to cause all this:

sudo nano /etc/gdm/custom.conf - enter your password when prompted.

Make sure neither of the following settings are "true":

[daemon]
TimedLoginEnable=false
AutomaticLoginEnable=false

If you had to change anything, press CTRL+O to save (write Out) the changes, then CTRL+X to eXit.

sudo shutdown -r now will restart the computer.