Refactored getting zooname cookie in zoo.php

Also added zooname to where clause in query in zoo.php