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’);