<?php
	class Session {
		
		public function getSessionId() {
			return session_id();
		}
		
		public function getSessionValue($key) {
			if (isset($_SESSION[$key])) {
				return $_SESSION[$key];
			} else {
				return false;
			}
		}
		
		public function refreshSession($key=null, $value=null) {
			$sessionValue = '';
			
			if (!is_null($key)) {
				if (isset($_SESSION[$key])) unset($_SESSION[$key]);
				
				$_SESSION[$key] = $value;
				$sessionValue = $_SESSION[$key];
			}
			
			return $sessionValue;
		}
		
		public function deleteSession($key) {
			if (isset($_SESSION[$key])) unset($_SESSION[$key]);
			
			return !isset($_SESSION[$key]);
		}
		
		public function sessionExists($key) {
			return isset($_SESSION[$key]);
		}
	}