How do I get Codeigniter CSRF protection to work properly with SSL?
===

I have CI CSRF protection turned on and it works fine with http. Once I turn on https (by changing the base URL of the site to https and redirecting all traffic from http to https) I begin to see:

`csrf token is missing on request`  

errors in the logs. Codeigniter reports this error in two cases:

1) csrf token is not in POST request 
2) csrf token cookie is not set or is expired.

All our post requests (mostly AJAX) have a csrf token because our custom ajax function includes it by default, so I'm thinking it must be #2. Additionally I have played around with the config choosing both the secure and non secure cookie setting, in both cases getting this error.

My guess is that the csrf token cookie is either not set or not encrypted. My main issue is that I cannot reproduce on my own system (Chrome on Ubuntu) but once I pushed to production I saw the logs immediately flare up.

Any ideas on what I am doing wrong or even how to debug a situation like this? Thanks!
 