Added rudimentary sign in functionality, also using cookies.