You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm developing for Laravel Octane. One issue I ran into is that the default configuration for the package is to use cookies for the sessionStorage & transientStorage. The PHP SDK's CookieStore will call setcookie(), which won't work when running on Octane1.
I didn't see anything in the Laravel package to offer another driver, so I implemented a StoreInterface that uses the the framework's sessions.
However: It was a little difficult to configure this. It didn't look like I could just give the two storage parameters the classpath in config/auth0.php; it expected instances. That's a bit of a bummer since caching the config would fail2.
I have two suggestions for enhancements of the Laravel package:
When a parameter in config/auth0.php is expected to be an object, allow it to be specified as a classpath and have the service container resolve it.
Add a StoreInterface implementation that uses the framework's session driver.
Running php artisan config:cache is what fails if you pass new MyCoolStorageDriver. I think I could have made the classes serializable to make it work, but that seems very un-Laravel-y. ↩
The text was updated successfully, but these errors were encountered:
Adding support for Laravel's session store is definitely on my radar as a next feature addition. I was unaware of the Octane limitation on setcookie() (particularly since I didn't have any issues in my tests with Octane using it), but it's good to know and further underscores the need for that storage support feature. I'm on it!
(particularly since I didn't have any issues in my tests with Octane using it)
It was failing specifically because this script does a couple log messages by writing output when it starts Octane up.
The easiest way I found to simulate that was adding an event listener to WorkerStarting in the config/octane.php that just echos something. It prints to the console, but it seems to count as output for the purposes of breaking setcookie().
What should be added?
I'm developing for Laravel Octane. One issue I ran into is that the default configuration for the package is to use cookies for the sessionStorage & transientStorage. The PHP SDK's
CookieStore
will callsetcookie()
, which won't work when running on Octane1.I didn't see anything in the Laravel package to offer another driver, so I implemented a
StoreInterface
that uses the the framework's sessions.However: It was a little difficult to configure this. It didn't look like I could just give the two storage parameters the classpath in
config/auth0.php
; it expected instances. That's a bit of a bummer since caching the config would fail2.I have two suggestions for enhancements of the Laravel package:
config/auth0.php
is expected to be an object, allow it to be specified as a classpath and have the service container resolve it.StoreInterface
implementation that uses the framework's session driver.Footnotes
See the Laravel Swoole notices, specifically point number 6. ↩
Running
php artisan config:cache
is what fails if you passnew MyCoolStorageDriver
. I think I could have made the classes serializable to make it work, but that seems very un-Laravel-y. ↩The text was updated successfully, but these errors were encountered: