Searched alot on this and noticed many having issues related to this but not my actual problem.
I have an Opencart 2.3.0.2 on Apache 2.4 / PHP 7.2 server with TLS enabled and forced.
The key here is that the installation have been working flawlessly for over a year with no modifications at all during this time.
But recently I get the dredded "Warning: You do not have permission to access the API!" in different places related to adding/modifying orders in admin section.
This is not related to my IP not added to api, I know how this work.
The thing is that if I spam the browsers refresh button it eventually works, like the error comes roughly 1 out of 3 refresh, but it differs.
I have located the line in different files in "catalog/controller/api" that couses the problem and it is:
Code: Select all
if (!isset($this->session->data['api_id'])) {
$json['error'] = $this->language->get('error_permission');
If I change it to the below the error goes away, but obviously I don't want to do that.
Code: Select all
if (false) {
$json['error'] = $this->language->get('error_permission');
Since the problem comes and goes my conslusion is that this must be a server side error, but I am not in full charge of the servers.
No information from the host provider has noticed me of any server change and the apache/php versions have been the same all time.
Any thoughts on how to troubleshoot this?