Add some code for Autentication

one error by creating a Cookies, fixed later ....