<?php
	// namespace
	namespace sven\sys\security;

	/**
	 * session
	 *
	 * Wrapping session functions
	 *
	 * @package sven\sys\security
	 * @copyright 2018 Ruben Meyer
	 * @author Ruben Meyer <contact@rxbn.de>
	 * @version 0.1.0
	 * @TODO Documentation
	 */
	class session {

		public static $id;

		public function __construct() {
			if (session_status() == PHP_SESSION_NONE) {
				session_start();
			}
		}

		public function write($key, $value) {
			$_SESSION[$key] = $value;
		}
		public function read($key) {
			if(isset($_SESSION[$key]))
				return $_SESSION[$key];
			else return false;
		}
		public function remove($key) {
			unset($_SESSION[$key]);
		}
		public function drop() {
			session_destroy();
		}
	};

?>
