added cookies and login/logout functionallity