It's a known problem that occurs sometimes. I read somewhere it could be caused by using some kde programs in gnome.
Try moving the .ICEauthority file in your homedir or remove it alltogether, a new iceauthority file will be generated.:
mv .ICEauthority .ICEauthority-old
and try to log into gnome again.