@Kris01 that should be well after the Session is started - I guess (based on the name of the middleware) that you have an authenticated user that you are working with in this middleware method? Can you share the code in the middleware?
@tykus Basically, one of the things I am doing, is checking his percentage of profile completition, if it is below 90% he should be redirected to his profile with a message.
@Kris01 but if it has the same middleware, then there would be potentially an infinite redirect (eventually you will see ERR_TOO_MANY_REDIRECTS message) - depending on that other middleware.
You seem to have a lot going in in these middlewares; are you able to reason about the outcomes for the various different scenarios???
@Kris01 flashed data only lives for one request cycle, so if there is a second redirect for some reason then the data will be lost unless it is re-flashed.
@Snapey@tykus hey guys, thanks for the help.
@tykus I'm re-saving it because, as @snapey says, the session is saved only for the next request.
It's going two times through the middleware so I have to re-save it