Slim 3 - $_SESSION on post route not working

Hi, using slim localhost all works fine. On production, inside post the $_SESSION variable only shows empty, i just don’t get it what i am doing wrong.
What i did and haven’t worked:

  • session.auto_start = 1 on php.ini
  • session_start() inside route
  • added session middleware

    $app->add(function ($request, $response, $next) {
    session_start();
    return $next($request, $response);
    });

It works here:

$app->get(‘/session/’, AcessoController::class . ‘:session’);

But not here:

$app->post(‘/anuncioindex/’, AnuncioController::class . ‘:anuncioindex’);

What does session_start(); returns on your production system? true or false?
What is the return value of session_status()?

session_start returns true, session_status returns 2