Create an insecure bank application
This commit is contained in:
21
webroot/lib/View/LoginRedirection.php
Normal file
21
webroot/lib/View/LoginRedirection.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user