Adding cookie check.

Signed-off-by: Ronald Huereca <ronalfy@gmail.com>