I have a website on shared hosting. I know that I should keep api tokens out of public_html folders on said website. I would like to use a <domain>/config/config.php file to hold those api tokens for Smartsheets. This approach is working for another application that I integrate with from this website.
However, when I put the api token for Smartsheet into this config.php file, and leave the sheet_ID and name in the files that call the api, it always fails. Debugging shows that it just can't find the api_token.
I have added CORS statements that allow origins from all subdomains of the website. These identical CORS statements work correctly with the other application that I integrate with from this website.
If I add the api_token into the php file (which is in a public_html folder) that calls the api, then everything works.
Why can't I put the api_token in a secure location?
I apologize if my question is not clearly stated. Please ask for clarifying information. Can share code if necessary.