I'm using the restserver in Codeigniter from Chris Kacerguis and I setup rest_auth with session. When I'm logged in, I access the page whose view.php get the response through file_get_contents and it's returning 401 Unauthorized. When I access the API's direct page in a new tab, it returns the json correctly.
the view.php is loading the API content in this way:
json_decode(file_get_contents('https://example.com/api/proces/'), true);
the response:
A PHP Error was encountered
Severity: Warning
Message: file_get_contents( I needed to remove the link ): failed to open >stream: HTTP request failed! HTTP/1.1 401 Unauthorized
What's happening?