fixed SID detection for preventing duplicate SID cookies (using defined)