login form generated by drupal_get_form('user_login_block') does not log in I have a custom module part of which builds a block with the login form

function my_module_block_view($delta = '') {
  switch ($delta) {
    case 'awsImage_public_info_forms':
      $user_login = drupal_get_form('user_login_block');
      $out = drupal_render($user_login);
      $block['content'] = $out;
      break;
    }
  return $block;
}


Form shows up on the page I have set the block to, BUT it will not log in. I can add and incorrect username / password and I'll get a drupal status error about the incorrect username, but when the login details are correct, it will not log in - the page will reload with "?destination=node/1137" - node/1137 is the node I am using the block on. Admin pages just show access denied.

I can log in via /user and there are no watchdog messages.
You shouldn't need to render the form, and this may be causing your problems. The output of drupal_get_form() is a render array, so you can use that directly. Try changing this:

$user_login = drupal_get_form('user_login_block');
$out = drupal_render($user_login);
$block['content'] = $out;


To this:

$block['content'] = drupal_get_form('user_login_block');


Also, are you doing anything else to the block with preprocessing or processing? Is the system rendering the block normally, or are you rendering the block in some different manner, with a template or something?