How to check if Drupal user is logged in via htaccess?
Drupal does store the session value in the cookie variable after the user is logged in. However, the name of this cookie is not fixed. It is basically a string that comes from the value returned by PHP function session_name; and starts with SESS. It would be hard to find and I would not recommend using regex, as I personally don't like it much.

If you really want to implement a solution with the cookie, I would suggest the following:


Implement hook_user_login() in a custom module:

function MODULE_user_login() {
  // set a new cookie here, with static name and value.
}

Implement hook_user_logout() and delete the cookie by setting an expiry date of past.


You can now use this cookie in your .htaccess!