apc.php 603 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php namespace System\Session;
  2. use System\Cache;
  3. class APC implements Driver {
  4. /**
  5. * Load a session by ID.
  6. *
  7. * @param string $id
  8. * @return array
  9. */
  10. public function load($id)
  11. {
  12. return Cache::driver('apc')->get($id);
  13. }
  14. /**
  15. * Save a session.
  16. *
  17. * @param array $session
  18. * @return void
  19. */
  20. public function save($session)
  21. {
  22. Cache::driver('apc')->put($session['id'], $session, Config::get('session.lifetime'));
  23. }
  24. /**
  25. * Delete a session by ID.
  26. *
  27. * @param string $id
  28. * @return void
  29. */
  30. public function delete($id)
  31. {
  32. Cache::driver('apc')->forget($id);
  33. }
  34. }