Added cookie authentication to login