Add getCookieFunction