Create cookie on login What is the latest and best way to set a cookie upon login? What I mean is:
if a user succesfully logins, then a session cookie user-is-logged-in = 1 is set. When the user logs out, this is removed.

I see this https://www.drupal.org/project/logincookie but its very old and doesn't look supported..
I see this but https://www.drupal.org/node/2160739 but it starts with a requirement with Varnish which I don't have..

I am using Drupal version 7.43.

As you know session cookies set by Drupal don't do the trick, as anonymous users are also set a cookie and from a browser's perspective, they are not differentiable. 

Thanks a lot for your help!
You could just write the code yourself in a custom module. What you want is pretty simple.

/**
 * Implements hook_user_login().
 */
function HOOK_user_login(&amp;$edit, $account) {
  setcookie('user-is-logged-in', '1', 0, '/');
}

/**
 * Implements hook_user_logout().
 */
function HOOK_user_logout($account) {
  // Set cookie in the past and then remove it.
  setcookie('user-is-logged-in', '', REQUEST_TIME - 3600, '/');
  unset($_COOKIE['user-is-logged-in']);
}