Calling the right createSessionCookie function and added a few debug messages