now it handles cookies