<?php
require 'db.php';

$userId = $_POST['user_id'];

$stmt = $pdo->prepare("
UPDATE login_sessions 
SET is_active = 0, logout_time = NOW()+ INTERVAL 8 HOUR
WHERE user_id = ? AND is_active = 1
");
$stmt->execute([$userId]);

echo "ok";
