Can I prepopulate an exposed filter text field? I want to get some value from session and put it into one of the exposed filter text fields of my view as default. Later the user can change the value and filter again.

Is there any way to do it? My session variable will be taken with:

&lt;?php return $_SESSION['ip_geoloc']['location']['city']; ?&gt;
You can use hook_form_alter and can give your session value as the default value of the exposed text field

The following code will help you

function MODULENAME_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == "views_exposed_form" &amp;&amp; $form['#id'] == "views-exposed-form-XXXXXXXX") {

    $form['#after_build'][] = 'some_function';

 }
}

function some_function($form, &amp;$form_state) {

 $default_value=$_SESSION['ip_geoloc']['location']['city'];
 $form['xxxxxx']['#default_value']=$default_value;

  return $form;
}