commit the cookie javascript