Create an insecure bank application
This commit is contained in:
16
webroot/lib/View/LogoutRedirection.php
Normal file
16
webroot/lib/View/LogoutRedirection.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace View;
|
||||
|
||||
use Model\Context;
|
||||
|
||||
class LogoutRedirection implements Sendable
|
||||
{
|
||||
public function send(): void
|
||||
{
|
||||
http_response_code(303); // "see other" redirection
|
||||
setcookie('sessid', '', 1); // delete cookie
|
||||
header('Location: /'); // redirection to home
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user