replaced this above line from 21-26 with this code
if (!$session->has('logedinUser')) {
	return $this->redirect($this->generateUrl('frontend_welcomepage'));
}
$logedinUser = $session->get('logedinUser');