SessionWrapper.php 330 B

123456789101112131415
  1. <?php
  2. class SessionWrapper {
  3. public function set($key, $value) {
  4. $_SESSION[$key] = $value;
  5. }
  6. public function get($key) {
  7. return $_SESSION[$key];
  8. }
  9. public function getDefault($key, $default) {
  10. return isset($_SESSION[$key]) ? $_SESSION[$key] : $default;
  11. }
  12. public function unsetKey($key) {
  13. unset($_SESSION[$key]);
  14. }
  15. }