cookie: split API into getter and setter (#209)

close #209