fixing the stupid: wrong implementations for cookie handling