lundi 13 février 2017

Laravel Sessionhandler

It looks like Laravel uses it's own implementation of a session instead of the session superglobal. The session is started and saved from the session middleware.

One thing the session superglobal does do though it implement a shutdown handler that always triggers a session to be stored. With Laravel's implementation this functionality seems to be lost.

This would probably mean that if something were to go wrong inside a controller you would not reach the middleware's save method.

It seems a shame to let to functionality go. I am hoping somebody could prove me wrong here and let me know if session still do get saved by maybe an errorhandler or something. But as of yet I have not found something like that in the codebase yet.

Does Laravel really not save the session when something goes wrong in the controller or is there a fallback in the codebase somewhere?

I guess the only time a session would not get saved is when you already are at the point in the lifecycle of your application, where you reached a controller with session data and threw a failure.

Cheers.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2l7m5PC
via IFTTT

Aucun commentaire:

Enregistrer un commentaire