Avoid message warnings if session was already started.

fix #2350

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign
2022-09-13 18:44:54 -03:00
parent a73be145d6
commit fcdde5cf57

View File

@@ -101,7 +101,9 @@ function check_cors()
function check_csrf($token)
{
// Start a new PHP session (or continue an existing one)
start_php_session();
if (session_status() != PHP_SESSION_ACTIVE) {
start_php_session();
}
if (!isset($_SESSION['token'])) {
log_and_die('Session expired! Please re-login on the Pi-hole dashboard.');