The issue lies with ini_set('session.cookie_secure', 1);
. Because you are testing on localhost, unless you have installed your own self signed certificate, your connection is not secure. Since you have told PHP only to send the cookie over a secure connection, no cookie is sent.
Your solution could be:
- Remove that setting entirely
- Comment it out for development and re-enable it when you push to production
- Use an if/else statement to determine if you are on localhost or in production and enable that setting accordingly