Improved cookie handling
added debug line