title: How does X11 authorization work? (MIT Magic Cookie)
body: <p>I am interested in an in-depth answer explaining how exactly X11 authorization works and especially MIT Magic Cookies.</p>
  <p>I understand that what it actually does is to forbid access to everyone else except the user that is logged in, also there are some control mechanisms that control whether a client application can connect to an X display server or not.</p>
  <p>I also found that there are five standard access control mechanisms and they can be categorized in three main categories:</p>
  <ol>
  <li>Access based on host</li>
  <li>Access based on cookie</li>
  <li>Access based on user</li>
  </ol>
  <p>But from this point and on I don't really understand the way these work and what ways they exactly use in order to do the authorizations.</p>