laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.4k stars 10.98k forks source link

I can't activate sessions in Lumen #12420

Closed MiguelPazo closed 8 years ago

MiguelPazo commented 8 years ago

Hi, i configured my app with lumen and i want to activate sessión with db. I uncomment next lines:

$app->middleware([ Illuminate\Session\Middleware\StartSession::class, Illuminate\View\Middleware\ShareErrorsFromSession::class ]);

And I added the service provider:

$app->register(Illuminate\Session\SessionServiceProvider::class);

Too add parram in .env file: SESSION_DRIVER=database

But I get the next error:

Unresolvable dependency resolving [Parameter #0 [ $app ]] in class Illuminate\Support\Manager

Please help me! my project is versioned in github:

https://github.com/MiguelPazo/ecep_service

rtucek commented 8 years ago

You're using Lumen v5.2. From this version on, views and sessions are no longer included. Mind release notes

GrahamCampbell commented 8 years ago

Views are actually still included in lumen 5.2.

GrahamCampbell commented 8 years ago

They got added back in 5.2.1 or something.

MiguelPazo commented 8 years ago

rtucek, i change to lumen 5.0, but now i get next error:

Argument 1 passed to Illuminate\Session\Middleware\StartSession::addCookieToResponse() must be an instance of Symfony\Component\HttpFoundation\Response, string given, called in D:\xampp\htdocs\ecep_service\vendor\illuminate\session\Middleware\StartSession.php on line 72 and defined

GrahamCampbell commented 8 years ago

lumen 5.0 is not supported

MiguelPazo commented 8 years ago

Then, what version should i use?

GrahamCampbell commented 8 years ago

5.1.x LTS is currently supported, as is 5.2.x stable.

MiguelPazo commented 8 years ago

Ok, thanks you! :+1:

maojindao55 commented 8 years ago

@GrahamCampbell as you said "They got added back in 5.2.1 or something.", but my lumen version is Lumen (5.2.7) (Laravel Components 5.2.*), it is the same issue Unresolvable dependency resolving [Parameter #0 [ $app ]] in class Illuminate\Support\Manager

solidevolution commented 8 years ago

Got this, too?!

What is the special, currently undocumented way to integrate a CSRF Token Validation to an RESTful framework?!

pirmax commented 6 years ago

I've the same issue...

yusufonur commented 5 years ago

I have the same issue, I using 5.8

jensdenies commented 5 years ago

@coderiki Sessions are not included out of the box in Lumen 5.8.

deyvisgc commented 4 years ago

@coderiki lo legraste solucionar tengo el mismo error y nose como solucionarlo

devmaster179 commented 4 years ago

Now I'm upgrading Lumen5.1 to 5.2 and getting the same issue. "Unresolvable dependency resolving [Parameter #0 [ $app ]] in class Illuminate\Support\Manager" How did you fix this error? Thanks.