Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java	(revision 32452)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractGS2FieldSearch.java	(revision 32453)
@@ -123,4 +123,15 @@
 			return false;
 		}
+
+		// set up which params to save
+		this.save_params.add(LEVEL_PARAM);
+		this.save_params.add(RANK_PARAM);
+		this.save_params.add(RAW_PARAM);
+		this.save_params.add(FIELD_QUERY_PARAM);
+		this.save_params.add(FIELD_STEM_PARAM);
+		this.save_params.add(FIELD_CASE_PARAM);
+		this.save_params.add(FIELD_ACCENT_PARAM);
+		this.save_params.add(FIELD_FIELD_PARAM);
+		this.save_params.add(FIELD_COMBINE_PARAM);
 		
 		// Get the default level out of <defaultLevel> (buildConfig.xml)
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractSearch.java	(revision 32452)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractSearch.java	(revision 32453)
@@ -128,4 +128,14 @@
 		  getSearchParamDefaults(search_elem);
 		}
+
+		// store any that we need to save
+		// previously these were all saved by default, so adding them all
+		this.save_params.add(INDEX_PARAM);
+		this.save_params.add(QUERY_PARAM);
+		this.save_params.add(RAW_PARAM);
+		this.save_params.add(MAXDOCS_PARAM);
+		this.save_params.add(HITS_PER_PAGE_PARAM);
+		this.save_params.add(START_PAGE_PARAM);
+		
 		// add some format info to service map if there is any 
 		// => lookin extra info first look in buildConfig
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractTextSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractTextSearch.java	(revision 32452)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractTextSearch.java	(revision 32453)
@@ -71,4 +71,23 @@
 	}
 
+  	public boolean configure(Element info, Element extra_info)
+	{
+		if (!super.configure(info, extra_info))
+		{
+			return false;
+		}
+
+		logger.info("Configuring AbstractTextSearch...");
+		// we need to set up the save_params - we want all our search settings saved by default
+		this.save_params.add(INDEX_SUBCOLLECTION_PARAM);
+		this.save_params.add(INDEX_LANGUAGE_PARAM);
+		this.save_params.add(CASE_PARAM);
+		this.save_params.add(STEM_PARAM);
+		this.save_params.add(ACCENT_PARAM);
+		this.save_params.add(MATCH_PARAM);
+
+		return true;
+
+	}
 	/** adds the standard query params into the service description */
 	protected void addStandardQueryParams(Element param_list, String lang)
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/BerryBasket.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/BerryBasket.java	(revision 32452)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/BerryBasket.java	(revision 32453)
@@ -66,5 +66,16 @@
 	protected static final String DELETE_ITEM_SERVICE = "DeleteItem";
 
+  // for AddItem
 	protected static final String ITEM_PARAM = "item";
+  // for DeleteItems
+  protected static final String ITEMS_PARAM = "items";
+  // for SendMail
+  protected static final String ADDRESS_PARAM = "address";
+  protected static final String SUBJECT_PARAM = "subject";
+  protected static final String CONTENT_PARAM = "content";
+  protected static final String CC_PARAM = "cc";
+  protected static final String BCC_PARAM = "bcc";
+
+  
 	protected static final String delimiter = "|";
 	protected static final int delay = 1800000;
@@ -171,4 +182,7 @@
 
 		}
+
+		// if any params should be saved in the session, add them to save_params here
+		// this.save_params.add(XXX_PARAM);
 		return true;
 
@@ -252,5 +266,5 @@
 		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
-		String item = (String) params.get("item");
+		String item = (String) params.get(ITEM_PARAM);
 		String collection = "";
 		int pos = item.indexOf(":");
@@ -334,5 +348,5 @@
 		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
-		String param = (String) params.get("items");
+		String param = (String) params.get(ITEMS_PARAM);
 
 		if (param == null)
@@ -496,9 +510,9 @@
 		HashMap<String, Serializable> params = GSXML.extractParams(param_list, false);
 
-		String to = (String) params.get("address");
-		String subject = (String) params.get("subject");
-		String content = (String) params.get("content");
-		String cc = (String) params.get("cc");
-		String bcc = (String) params.get("bcc");
+		String to = (String) params.get(ADDRESS_PARAM);
+		String subject = (String) params.get(SUBJECT_PARAM);
+		String content = (String) params.get(CONTENT_PARAM);
+		String cc = (String) params.get(CC_PARAM);
+		String bcc = (String) params.get(BCC_PARAM);
 
 		String mailhost = GlobalProperties.getProperty("mail.smtp.host");
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java	(revision 32452)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java	(revision 32453)
@@ -83,4 +83,12 @@
 		this.short_service_info.appendChild(dmr_service);
 
+
+		// what params do we want saved in the session?
+		this.save_params.add(QUERY_PARAM);
+		this.save_params.add(COLLECTION_PARAM);
+		this.save_params.add(GROUP_PARAM);
+		this.save_params.add(MAXDOCS_PARAM);
+		this.save_params.add(HITS_PER_PAGE_PARAM);
+		
 		// get any format info
 		Element format_info = (Element) GSXML.getChildByTagName(info, GSXML.FORMAT_ELEM);
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Construct.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Construct.java	(revision 32452)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Construct.java	(revision 32453)
@@ -109,4 +109,6 @@
 	}
 
+  // in configure we set up any params that should be saved to the session. At this stage, assuming none should be saved.
+  
 	/** returns a specific service description */
 	protected Element getServiceDescription(Document doc, String service, String lang, String subset)
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2LuceneSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2LuceneSearch.java	(revision 32452)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2LuceneSearch.java	(revision 32453)
@@ -64,4 +64,16 @@
 	}
 
+  public boolean configure(Element info, Element extra_info)
+  {
+    if (!super.configure(info, extra_info))
+      {
+	return false;
+      }
+    logger.info("Configuring GS2LuceneSearch...");
+
+    // add our reverseSort param to be saved to the session
+    this.save_params.add(SORT_ORDER_PARAM);
+    return true;
+  }
 	/** add in the Lucene specific params to TextQuery */
 	protected void addCustomQueryParams(Element param_list, String lang)
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ServiceRack.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ServiceRack.java	(revision 32452)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/ServiceRack.java	(revision 32453)
@@ -21,4 +21,5 @@
 // greenstone classes
 import java.lang.reflect.Method;
+import java.util.ArrayList;
 import java.util.HashMap;
 
@@ -30,4 +31,5 @@
 import org.greenstone.gsdl3.util.Dictionary;
 import org.greenstone.gsdl3.util.GSFile;
+import org.greenstone.gsdl3.util.GSParams;
 import org.greenstone.gsdl3.util.GSPath;
 import org.greenstone.gsdl3.util.GSXML;
@@ -95,4 +97,7 @@
 	protected HashMap<String, Node> format_info_map = null;
 
+  /** the list of cgi params that this services are looking for, that need saving in the session */
+  protected ArrayList<String> save_params = null;
+  protected ArrayList<String> sensitive_params = null;
 	protected Element _globalFormat = null;
 
@@ -159,4 +164,21 @@
 	}
 
+  public boolean addServiceParameters(GSParams params) {
+
+    if (params == null) {
+      logger.error("params is null!!!");
+      return false;
+    }
+    
+    for (int i=0; i<save_params.size(); i++) {
+      logger.error("adding save param "+save_params.get(i));
+      params.addServiceParameter(save_params.get(i), "", true, false);
+    }
+    for (int i=0; i<sensitive_params.size(); i++) {
+      params.addServiceParameter(sensitive_params.get(i), "",   false, true);
+    }
+    return true;
+
+  }
 	/** the no-args constructor */
 	public ServiceRack()
@@ -166,4 +188,6 @@
 		this.short_service_info = this.desc_doc.createElement(GSXML.SERVICE_ELEM + GSXML.LIST_MODIFIER);
 		this.format_info_map = new HashMap<String, Node>();
+		this.save_params = new ArrayList<String>();
+		this.sensitive_params = new ArrayList<String>();
 	}
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/UserTracker.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/UserTracker.java	(revision 32452)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/UserTracker.java	(revision 32453)
@@ -16,5 +16,5 @@
 public class UserTracker extends ServiceRack
 {
-	static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.DocXMLUtil.class.getName());
+	static Logger logger = Logger.getLogger(org.greenstone.gsdl3.service.UserTracker.class.getName());
 
 	/**************************************************
@@ -27,4 +27,11 @@
 	String[] services = { RECORD_USER_ACTION, GET_ACTIVITY_ON_PAGE };
 
+  // the parameters these services use
+  protected static final String USER_PARAM = "username";
+  protected static final String COLLECTION_PARAM = "collection";
+  protected static final String SITE_PARAM = "site";
+  protected static final String OID_PARAM = "oid";
+  protected static final String ACTION_PARAM = "action";
+  
 	/** configure this service */
 	public boolean configure(Element info, Element extra_info)
@@ -35,5 +42,5 @@
 		}
 
-		logger.info("Configuring DocXMLUtil...");
+		logger.info("Configuring UserTracker...");
 		this.config_info = info;
 
@@ -46,4 +53,8 @@
 		}
 
+		// should any of the params be saved to the session?
+		// assuming not at this stage. But if they do need to be, then
+		// sture them here in save_params.
+		// this.save_params.add(XXX_PARAM);
 		return true;
 	}
@@ -78,9 +89,9 @@
 
 		HashMap<String, Serializable> params = GSXML.extractParams(paramList, true);
-		String username = (String) params.get("username");
-		String collection = (String) params.get("collection");
-		String site = (String) params.get("site");
-		String oid = (String) params.get("oid");
-		String action = (String) params.get("action");
+		String username = (String) params.get(USER_PARAM);
+		String collection = (String) params.get(COLLECTION_PARAM);
+		String site = (String) params.get(SITE_PARAM);
+		String oid = (String) params.get(OID_PARAM);
+		String action = (String) params.get(ACTION_PARAM);
 
 		DerbyWrapper database = new DerbyWrapper(GlobalProperties.getGSDL3Home() + File.separatorChar + "etc" + File.separatorChar + "usersDB");
@@ -106,7 +117,7 @@
 
 			HashMap<String, Serializable> params = GSXML.extractParams(paramList, true);
-			String collection = (String) params.get("collection");
-			String site = (String) params.get("site");
-			String oid = (String) params.get("oid");
+			String collection = (String) params.get(COLLECTION_PARAM);
+			String site = (String) params.get(SITE_PARAM);
+			String oid = (String) params.get(OID_PARAM);
 
 			DerbyWrapper database = new DerbyWrapper(GlobalProperties.getGSDL3Home() + File.separatorChar + "etc" + File.separatorChar + "usersDB");
