if (session!=null) {
// delete any session authentication information first
if (realm==null) {
DBConnection connection = db.getConnection();
try {
connection.update(AuthDB.DELETE_USER_AUTHENTICATION, new DBUpdateHandler() {
public void prepare(PreparedStatement s)
throws SQLException
{
s.setInt(1,id);
s.setString(2,session.toString());