2019-09-26 04:27:05 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
namespace MVC\Classe;
|
|
|
|
|
|
|
|
|
|
|
|
class Session
|
|
|
|
{
|
|
|
|
|
2019-10-11 15:26:22 +02:00
|
|
|
static public function start()
|
|
|
|
{
|
|
|
|
session_start();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static public function setUserProfile($userProfile)
|
|
|
|
{
|
|
|
|
$_SESSION['userProfile'] = $userProfile;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
static public function setToken($token)
|
|
|
|
{
|
|
|
|
$_SESSION['userToken'] = $token;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-09-26 04:27:05 +02:00
|
|
|
static public function isRegistered()
|
|
|
|
{
|
|
|
|
if (isset($_SESSION['userProfile'])) {
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
header("location : " . Url::link_rewrite(false, 'error', []));
|
|
|
|
die('Ooops, something was wrong...');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|