Check if you do not outject anything else to session scope on variable
That would explain things, except that outjecting to APPLICATION scope works as expected. If a null was being outjected then I'd expect the same behavior in APPLICATION or SESSION, which is not the case.
I meant you set session variable
idto null from somewhere else in your app.