Fixed cookie lookup (probably a hack)