Change: refactor the functions for cookie poisoning

Signed-off-by: paulyang <y_y@neusoft.com>