I can't seem to find any way to do sorting of middleware in Lumen. Session auth is being used by the application and the problem is, Authenticate middleware is being called first before StartSession thus resulting in session not behaving properly/not saved.
I know there's SortedMiddleware component but not really sure where to fit that one.
Using xdebug to trace the stack, it seems StartSession is called first and then Authenticate next.
After a successful login, Authenticate middleware would fail because it can't get user data from session because it's empty.