ConsoleKit is a framework for managing user sessions and permissions. Some of the most common usages of consolekit is allowing non-root users to mount removable media and suspending/shutting down the computer through common desktop applications (ie: thunar, nautilus, the gnome shutdown menu, etc).
Display manager usage
exec ck-launch-session startxfce4
Running several applications from ~/.xinitrc
If several applications are to be executed from Template:Filename, not all of these will have consolekit environment variables set. In the following example, only children of compiz will be able to properly use conosolekit, but children of xterm won't.
xterm & exec ck-launch-session compiz ccp
Typically, this can be an issue when for example using compiz standalone and some other application launchers, (gnome-do, kupfer, gmrun, xbindkeys, etc.) since children of the application launcher won't be able to use consolekit. A dirty workaround is to have the entire session started by a second script, e.g. Template:Filename. Don't forget dbus-launch, it's likely you need it too: