update cookie api & authcode type