centralized cookie-handling