I would recommend checking the path of the cookie that Magento sets. Most likely, it is set to /shop
, so the cookie will not be accessible to your file above it.
You can modify the path that Magento uses to set its cookie in the control panel under System -> Configuration -> Web (under the General heading) -> Session cookie management