src: cookie handle function