Instead of doing a require
to include the "logout success" content, do a Header("Location: http://domain/path-to-logout-success.php")
.
Once the HTTPS negotiation has occurred, you can't set a cookie for the "other" protocol. Only once the user's browser requests the "other" protocol can you set a cookie for it.