Adds session variables check and set as required and logout