trying to add cookie functionality, but it's not working