Daan is sweet to Kelley and delegates himself TestCMS code reflection
[ssproject1617.git] / testcms-final-anon / system / classes / session.php
1 <?php defined('IN_CMS') or die('No direct access allowed.');
2
3 /*
4 This will handle our native sessions for now
5 but provides somes flexibility in the future
6 if we decide to use other methods for
7 session management
8 */
9
10 class Session {
11
12 public static function start() {
13 session_start();
14 }
15
16 public static function end() {
17 session_write_close();
18 }
19
20 public static function get($key, $default = false) {
21 return isset($_SESSION[$key]) ? $_SESSION[$key] : $default;
22 }
23
24 public static function set($key, $value) {
25 $_SESSION[$key] = $value;
26 }
27
28 public static function forget($key) {
29 if(isset($_SESSION[$key])) {
30 unset($_SESSION[$key]);
31 }
32 }
33
34 }