added cookie authentication