diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2021-10-18 21:15:18 +0100 |
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2021-10-18 21:15:18 +0100 |
| commit | 1a112ab14becaf6d41cd34c176cbe563d4ca9742 (patch) | |
| tree | aad7dd85d9a7d3d4465a6ef506a0259b46ed6ee7 /public/store/index.php | |
| parent | cbaedbc5251f3b127bd81242d1344c0cd3e56e0c (diff) | |
Implement session management
Diffstat (limited to 'public/store/index.php')
| -rw-r--r-- | public/store/index.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/public/store/index.php b/public/store/index.php index 2a84c59..45765d5 100644 --- a/public/store/index.php +++ b/public/store/index.php @@ -4,13 +4,16 @@ declare(strict_types=1); use DTS\Bookmark; use DTS\BookmarkRepository; -use function DTS\Functions\respondAndExit; +use DTS\Session; use function DTS\Functions\redirectAndExit; +use function DTS\Functions\respondAndExit; require_once(__DIR__.'/../../autoload.php'); $config = require_once(__DIR__.'/../../config.php'); +$session = Session::getInstance(); + if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') !== 'POST') { respondAndExit(405, 'Method Not Allowed'); } @@ -30,4 +33,6 @@ if (!$bookmarks->add($bookmark)) { respondAndExit(500, 'Internal Server Error'); } +$session->set('message', 'Bookmark Added'); + redirectAndExit('/'); |
