Loop all session variables.

Three questions.

1) Is it possible to loop through all current session variables. I wish to loop through them and delete / clear some.
2) Is it possible to alter screen-scraper in a way that it returns an empty string if a variable does not exists instead of a null value?
3) Is it possible to add custom methods to the session scope. E.g. session.myMethod();

Kind Regards,
Nebu

There isn't a way to loop all

  1. There isn't a way to loop all session variables, but at the same time, you shouldn't have many. The only things that need to be session variables are those that need to live between requests--like collating data or navigation. I find new scrapers are sometimes too eager to use a session variable when a DataSet or DataRecord would do--and they are self removing.
  2. Not by default, but I've had cases where I do so in a script.
    if (dataRecord.get("VALUE")==null) dataRecord.put("VALUE", "");
  3. It is not, but you can create a library (jar file), put it in screen-scraper/lib/ext and call it.