sql_references(): rename 'action' => 'return'; add 'return' options 'filters' and 'selects'
fix calls to sql_references(), use in prune_sessions()
implement session lifetime: sessions expire after specified time with no user interaction