Typo in cookie test and bug in cookie class

Signed-off-by: emanuele <emanuele45@gmail.com>