removed dead code
furtherly continued working  on session refresh (beware of endless loops)