ShiHeng's sql cookie management.