Cookie creation bugfix