To set the session handling method before connect. If you want PHP to handle it with cookie, set it to GM_USE_PHPSESSION|GM_USE_COOKIE; if you want PHP to handle it but without using cookie, set it to !GM_USE_COOKIE|GM_USE_PHPSESSION; if you do not want PHP to handle it, set it to GM_USE_COOKIE|!GM_USE_PHPSESSION. It will set to GM_USE_PHPSESSION|GM_USE_COOKIE by default.