views exposed form alter hook works with login but not work with out login? I have created views exposed form for searching title based content and i want to display search results into another page for this i have wrote below code in my custom module,it's working fine with login but can't work with out login please advice.

&lt;?php
function module_name_form_views_exposed_form_alter(&amp;$form, &amp;$form_state, $form_id) {
 drupal_set_message('Form Hook Called');//just to check that hook is called by drupal
  if($form['#id'] == 'form id here')
  {

    $form['#action'] = base_path().'path';
  }
}


Thanks,
Please check your code on search_redirect_permission.You have to use 

access search_redirect module content in user_access function to display result.You have to use search api under anonymus login codition.

Something like:

if (user_access('access search_redirect module content')) {
  // search results!
 } else {
  // no search results!
 }


But I don't understand why you are using hook_permission(),if it should be viewed by anonymous users.

EDIT: For form redirect you should do something like:

function MYMODULE_form_alter(&amp;$form, &amp;$form_state, $form_id)
{

    if($form_id == 'your_form_id')
    {
      //YOUR SOME LOGIC IF ANY
      $form['#submit'] = array('custom_form_submit_handler');
    }
}


function custom_form_submit_handler($form, $form_state)
{
//YOUR SOME LOGIC IF ANY
   $form_state['redirect'] = 'your_url';
}