defined constructor function
check if user is logged in all the public pages and display logout link if yes