fix session restart on PHP 5.3

this also removes some useless code