=== modified file 'includes/bootstrap.inc'
--- includes/bootstrap.inc	2008-01-02 14:29:32 +0000
+++ includes/bootstrap.inc	2008-01-02 14:55:33 +0000
@@ -841,6 +841,7 @@ function drupal_is_denied($type, $mask) 
  * @return Object - the user object.
  */
 function drupal_anonymous_user($session = '') {
+  setcookie('drupal_login_check', TRUE, time() + 31536000, '/');
   $user = new stdClass();
   $user->uid = 0;
   $user->hostname = ip_address();

=== modified file 'modules/user/user.module'
--- modules/user/user.module	2007-12-28 12:02:49 +0000
+++ modules/user/user.module	2008-01-02 15:07:01 +0000
@@ -74,6 +74,10 @@ function user_theme() {
     'user_signature' => array(
       'arguments' => array('signature' => NULL),
     ),
+    'user_no_cookie' => array(
+      'file' => 'user.pages.inc',
+      'arguments' => array('domain' => NULL),
+    ),
   );
 }
 
@@ -905,6 +909,13 @@ function user_menu() {
     'type' => MENU_LOCAL_TASK,
     'file' => 'user.pages.inc',
   );
+  $items['user/no-cookie'] = array(
+    'title' => 'Please enable cookies',
+    'page callback' => 'user_no_cookie',
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+    'file' => 'user.pages.inc',
+  );
   $items['user/reset/%/%/%'] = array(
     'title' => 'Reset password',
     'page callback' => 'drupal_get_form',
@@ -1338,15 +1349,20 @@ function user_authenticate_finalize(&$ed
 }
 
 /**
- * A validate handler on the login form. Update user's login timestamp, fire
+ * A submit handler on the login form. Update user's login timestamp, fire
  * hook_user('login), and generate new session ID.
  */
 function user_login_submit($form, &$form_state) {
   global $user;
   if ($user->uid) {
     $form_state['redirect'] = 'user/'. $user->uid;
-    return;
   }
+  if (!isset($_COOKIE['drupal_login_check'])) {
+    unset($_REQUEST['destination']);
+    drupal_goto('user/no-cookie');
+  }
+  // Set some time in the past, I used the value for the Expires header.
+  setcookie('drupal_login_check', TRUE, 280299600, '/', ini_get('session.cookie_domain'));
 }
 
 /**

=== modified file 'modules/user/user.pages.inc'
--- modules/user/user.pages.inc	2008-01-02 12:57:37 +0000
+++ modules/user/user.pages.inc	2008-01-02 14:54:13 +0000
@@ -363,3 +363,13 @@ function user_page() {
     return drupal_get_form('user_login');
   }
 }
+
+function user_no_cookie() {
+  global $base_url;
+  $url = parse_url($base_url);
+  return theme('user_no_cookie', $url['host']);
+}
+
+function theme_user_no_cookie($domain) {
+  return t('It seems that your browser does not accept cookies. To log into this site, you need to accept cookies from the domain @domain.', array('@domain' => $domain));
+}

