When you are testing this are you entering a password or are you using the auto login portion? The standard login seems to be setup correctly to me, but the auto login authenticate user server behavior seems incorrect. It looks like you are referencing the username session variable and the posted password. You should instead reference $_COOKIE["AutoLoginUN"] for the username and $_COOKIE["AutoLoginPWD"] for the password.
Other than this I do not see a problem with the current setup. If you continue to have trouble with this please post back with a copy of your db. I do not need to have any records, the structure will do.
As for saving the search query this is done on the DataAssist created results page. On this page you will see a section of code like this:
//save the query in a session variable
if (1 == 1) {
$_SESSION["WADbSearch1_1items_Results"]=$WADbSearch1->whereClause;
}
You session variable name will differ from this example. You can just comment out the line within the if statement with two slashes like this:
//save the query in a session variable
if (1 == 1) {
//$_SESSION["WADbSearch1_1items_Results"]=$WADbSearch1->whereClause;
}
This will make it so the results are not held in a session variable.