Hi
I try to use the middleware PSR-7 Storage-less HTTP Sessions (4.0.0) with Slim 3.10…
I created a project with the slim/skeleton, adding the middleware with composer
composer require psr7-sessions/storageless
Next step, adding some settings in settings.php to specify key and session lifetime…
Finally, i added the folliowing line in middlewares.php
$app->add(\PSR7Sessions\Storageless\Http\SessionMiddleware::fromSymmetricKeyDefaults($container->get('settings')['session']['key'],$container->get('settings')['session']['sessionLifetime']));
… I received from slim :
Slim Application Error
The application could not run because of the following error:
Details
Type: RuntimeException
Message: {} is not resolvable
File: /home/eric/slim-lpdp/vendor/slim/slim/Slim/CallableResolver.php
Line: 104
Trace
#0 /home/eric/slim-lpdp/vendor/slim/slim/Slim/CallableResolver.php(56): Slim\CallableResolver->assertCallable(Object(PSR7Sessions\Storageless\Http\SessionMiddleware))
#1 /home/eric/slim-lpdp/vendor/slim/slim/Slim/CallableResolverAwareTrait.php(45): Slim\CallableResolver->resolve(Object(PSR7Sessions\Storageless\Http\SessionMiddleware))
#2 /home/eric/slim-lpdp/vendor/slim/slim/Slim/DeferredCallable.php(36): Slim\DeferredCallable->resolveCallable(Object(PSR7Sessions\Storageless\Http\SessionMiddleware))
#3 [internal function]: Slim\DeferredCallable->__invoke(Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#4 /home/eric/slim-lpdp/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(70): call_user_func(Object(Slim\DeferredCallable), Object(Slim\Http\Request), Object(Slim\Http\Response), Object(Closure))
#5 /home/eric/slim-lpdp/vendor/slim/slim/Slim/MiddlewareAwareTrait.php(117): Slim\App->Slim\{closure}(Object(Slim\Http\Request), Object(Slim\Http\Response))
#6 /home/eric/slim-lpdp/vendor/slim/slim/Slim/App.php(406): Slim\App->callMiddlewareStack(Object(Slim\Http\Request), Object(Slim\Http\Response))
#7 /home/eric/slim-lpdp/vendor/slim/slim/Slim/App.php(314): Slim\App->process(Object(Slim\Http\Request), Object(Slim\Http\Response))
#8 /home/eric/slim-lpdp/public/index.php(30): Slim\App->run()
#9 {main}
Where I’m wrong ? Could you help ?
Thanks for your support
Eric