Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jakeryansmith's avatar

How to session config dynamically? Really confused.

Is it possible to dynamically set the session configuration using Config::set() ? It appears that "Illuminate\Session\Middleware\StartSession" gets called before all other middleware, regardless of what position it's in. Am I correct in thinking that the middleware should be called in the order it is set in Kernal.php ? I would like to set my session data dynamically with my own custom middleware, but it seems to have no effect. I confirmed that StartSession is being called first when I did a dd() in both he 'StartSession' and my custom middleware, it didn't matter if the custom middleware was listed first, the StartSession dd() was outputed. So is StartSession being called somewhere else? Is it possible to set the sessions config dynamically? Thanks!

0 likes
0 replies

Please or to participate in this conversation.