Getting value from cookie.txt

Thanks. That worked. It now shows correctly. If I used the template editor, I am able to get the correct information. However, the switch is not showing up. To simplify things, I am now trying to get the cookie directly in the switch rather than storing it in my secrets.yaml and then trying to get it in the switch. Once that is working, I will move it over to my secrets. Is the cookie line below correct?

  - platform: rest
    name: Reef Light
    resource: http://myip:port/api/equipment/1
    username: !secret reef_username
    password: !secret reef_password
    body_on: '{"id":"1","name":"Light","outlet":"1","on":true}'
    body_off: '{"id":"1","name":"Light","outlet":"1","on":false}'
    is_on_template: '{{ value_json.on }}'
    headers:
        Connection: keep-alive
        content-type: application/json
        Referer: http://myip:port
        Cookie: states('sensor.reef_cookie')

I have also tried

        Cookie: "{{ states('sensor.reef_cookie') }}"