Preventing multiple iterations. Issue: #4350 

Remove the possibility to create an infinite loop in SessionHelper. #4350