@Linux-Swat: AFAIR they are set from within the xinitrc-process, i.e. after logging in with slim while starting X.
@Letalis: I can't come up with an example right now, but I remember that i have been in a situation where I was writing a script and where the SUDO_USER/SUDO_UID/GID are not available or helpful. Thankfully ED pointed me to /tmp/currentuser back then.