rewrited cookie lib, fix stupid bug