22 lines
492 B
PHP
22 lines
492 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace View;
|
|
|
|
use Model\Context;
|
|
|
|
class LoginRedirection implements Sendable
|
|
{
|
|
public function __construct(protected Context $context)
|
|
{
|
|
}
|
|
|
|
public function send(): void
|
|
{
|
|
$sessid = $this->context->session->newSessid;
|
|
http_response_code(303); // "see other" redirection
|
|
setcookie('sessid', $sessid, time() + 86400 * 365); // session creation
|
|
header('Location: /bookings.php'); // login redirection
|
|
}
|
|
}
|