Skip to content
This repository has been archived by the owner on Mar 29, 2019. It is now read-only.

Using without session #44

Open
bohdankolecek opened this issue Sep 9, 2015 · 1 comment
Open

Using without session #44

bohdankolecek opened this issue Sep 9, 2015 · 1 comment

Comments

@bohdankolecek
Copy link

We need to call GET /me for every given access token in ReactPHP CLI script. Kdyby\Facebook\SessionStorage class depends on Nette\Http\Session which calls session_start(), which causes the following error in the CLI script:

Cannot send session cache limiter - headers already sent

Is it possible to use the Kdyby/Facebook without opening the session?

Traceback follows:

#0 /var/www/project/vendor/nette/utils/src/Utils/Callback.php(87): Nette\Http\Session->Nette\Http\{closure}('Cannot send ses...', 2)
#1 [internal function]: Nette\Utils\Callback::Nette\Utils\{closure}(2, 'session_start()...', '/var/www/projec...', 96, Array)
#2 /var/www/project/vendor/nette/utils/src/Utils/Callback.php(96): session_start()
#3 /var/www/project/vendor/nette/http/src/Http/Session.php(99): Nette\Utils\Callback::invokeSafe('session_start', Array, Object(Closure))
#4 /var/www/project/vendor/nette/http/src/Http/SessionSection.php(54): Nette\Http\Session->start()
#5 /var/www/project/vendor/nette/http/src/Http/SessionSection.php(225): Nette\Http\SessionSection->start()
#6 /var/www/project/vendor/kdyby/facebook/src/Kdyby/Facebook/SessionStorage.php(135): Nette\Http\SessionSection->remove()
#7 /var/www/project/vendor/kdyby/facebook/src/Kdyby/Facebook/Facebook.php(602): Kdyby\Facebook\SessionStorage->clearAll()
#8 /var/www/project/vendor/kdyby/facebook/src/Kdyby/Facebook/Api/CurlClient.php(383): Kdyby\Facebook\Facebook->destroySession()
#9 /var/www/project/vendor/kdyby/facebook/src/Kdyby/Facebook/Api/CurlClient.php(197): Kdyby\Facebook\Api\CurlClient->resolveAPIException(Array)
#10 /var/www/project/vendor/kdyby/facebook/src/Kdyby/Facebook/Api/CurlClient.php(166): Kdyby\Facebook\Api\CurlClient->callOauth(Object(Nette\Http\UrlScript), Array)
#11 /var/www/project/vendor/kdyby/facebook/src/Kdyby/Facebook/Facebook.php(173): Kdyby\Facebook\Api\CurlClient->graph('/me', NULL, Array)
#12 /var/www/project/app/model/TokenServiceRepository.php(70): Kdyby\Facebook\Facebook->api('/me')
@fprochazka
Copy link
Member

@BohdanK have you tried using https://github.com/Kdyby/FakeSession ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants