Own cookie implementation added to reduce external dependencies.