<?php

namespace Helpers;

use Exception;

final class Session
{
    public static function tiene($variable_session)
    {
        if (isset($_SESSION[$variable_session])) {
            return true;
        } else {
            return false;
        }
    }

    public static function get($variable_session)
    {
        try {
            $mensaje = $_SESSION[$variable_session];
            $tipo = $_SESSION['tipo'];
            unset($_SESSION[$variable_session]);
            unset($_SESSION['tipo']);
            return "<div class='alert alert-{$tipo}'>" . $mensaje . '</div>';
        } catch (Exception $ex) {
        }
    }
}
