PHP Session Class (Light)


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. class Session
  2. {
  3.  
  4. // start session
  5. public function start()
  6. {
  7. }
  8.  
  9. public function create($name, $val)
  10. {
  11. $_SESSION[$name] = $val;
  12. }
  13.  
  14. public function get($name)
  15. {
  16. if (isset($_SESSION[$name]))
  17. {
  18. return $_SESSION[$name];
  19. }
  20. else
  21. {
  22. return false;
  23. }
  24. }
  25.  
  26. public function del($name)
  27. {
  28. unset($_SESSION[$name]);
  29. }
  30.  
  31. public function end()
  32. {
  33. $_SESSION = array();
  34. }
  35.  
  36. }

URL: http://www.jream.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.