Hi,
I have two questions.
1. I have several php files doing requests to a REST API and I need to make a request to /login at the start of each file. I'm using 'cookies' => true to make the subsequent requests.
I'm looking for a way to eliminate this request to /login from each file and only do it once. The other files should be able to tell that I'm logged in. From what I've read I think that this is done through a cookieplugin, which I should add in login.php and save it in $_SESSION['cookieplugin']. Then I would have to retrieve it from a.php, b.php and so on and subscribe to this session variable.
Is that correct?
2. I tried to do the above in guzzle v4:
use Guzzle\Plugin\Cookie\CookiePlugin;
use Guzzle\Plugin\Cookie\CookieJar\ArrayCookieJar;
$cookiePlugin = new CookiePlugin(new ArrayCookieJar());
$_SESSION['cookieplugin']= $cookiePlugin;
I'm getting an error:
Fatal error: Class 'Guzzle\Plugin\Cookie\CookiePlugin' not found
Any ideas?