<?php
session_start();

header('Content-Type: application/json');

if (!isset($_SESSION['front_user_id'])) {
    echo json_encode(['success' => false, 'message' => 'No session']);
    exit();
}

// Regenerate session ID to reset absolute timeout
session_regenerate_id(true);

$_SESSION['last_activity'] = time();

echo json_encode(['success' => true, 'message' => 'Session refreshed']);
?>
