solve the problem of cookie