I think that you can do one thing (but make it temp) and remove it when deploy to production
private void saveToSession(
String name, Object value){
if(value == null){
removeFromSession(name);
}else{
if (!(value instanceof Serializable)) {
\\log("The Object --->>>" + name + " is not serialized");
}
getSession().setAttribute(name, value);
}
}