use inCookie as a function