Session.getLastError implementation