<?php
    use App\MyUser;
    if (!isset($_SESSION['login'])) {
        header('Location: signin');
    }
    

    try {
        $user = new MyUser($_SESSION['login']);
        $user->delete();
        header('Location: ../signin');
        exit();
    }
    catch (PDO $e) {
        $_SESSION['message'] = $e->getMessage();
        header('Location: welcome');
        exit();
    }
