Display/hide CCk field with custom PHP and rules or
Two quick ways come to mind.

Off the cuff...

You could use the preprocess_node() hook, something along the lines of:

MYMODULE_preprocess_node(&amp;$variables) {

  if ($variables['node']-&gt;type=='THISKINDOFNODE') {

    if (empty($_SESSION['VARIABLE')) {
      unset($variables['node']-&gt;field_B;
    } else {
      unset($variables['node']-&gt;field_A;
    }

  }

  // other preprocessing here

}


You also could create a node--TYPE.tpl.php file and inside it, do something like this:

if (empty($_SESSION['VARIABLE'])) {
  hide($content['field_B');
} else {
  hide($content['field_A');
}