Improve cookie initialization.