Is it related to DISPLAY? and useful for remotely login a x server to control the local display?
short: not exactly
long: This is an environment variable which may be set for ConsoleKit. According to its documentation,
ConsoleKit is a framework for keeping track of the various users, sessions, and seats present on a system. It provides a mechanism for software to react to changes of any of these items or of any of the metadata associated with them.
and goes on to say
A session is a collection of all processes that share knowledge of a secret. In the typical (or ideal) case, these processes all originate from a single common ancestor.
As an implementation detail, for now, this secret should be stored in the process environment by the session leader under the name
XDG_SESSION_COOKIE
. When and if we are able to take advantage of a mechanism in the underlying system to store session registration information - we will. However, such a mechanism is not known at the present time.
Noting that the question was asked early in 2014, the ConsoleKit webpage says (last updated September 2013)
ConsoleKit is a framework for defining and tracking users, login sessions, and seats.
ConsoleKit is currently not actively maintained. The focus has shifted to the built-in seat/user/session management of Software/systemd called systemd-logind!
In turn, systemd-logind
says
systemd-logind
is a system service that manages user logins.
It is not related to DISPLAY
, but rather to authentication needed to connect to a given X server.
Further reading:
- What is the XDG_SESSION_COOKIE environment variable for?
- How can I configure dbus to allow ssh-user to suspend server?
- RedHat #771538: XDG_SESSION_COOKIE is set on non-gdm login. reported that
XDG_SESSION_COOKIE
is set on non-gdm login, preventing proper access to sound (pulse-audio) when usingstartx
. - Ubuntu #302791: ssh not setting XAUTHORITY, XDG_SESSION_COOKIE reported that
When logging in to a machine through ssh (without -X or -Y),
XAUTHORITY
is not set; and when logging in non-interactively,XDG_SESSION_COOKIE
is not set. This prevents programs started over an ssh session to connect to the X server of the machine on which it's running.