session.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * Lithium: the most rad php framework
  4. *
  5. * @copyright Copyright 2010, Union of RAD (http://union-of-rad.org)
  6. * @license http://opensource.org/licenses/bsd-license.php The BSD License
  7. */
  8. /**
  9. * This configures your session storage. The Cookie storage adapter must be connected first, since
  10. * it intercepts any writes where the `'expires'` key is set in the options array.
  11. */
  12. use lithium\storage\Session;
  13. /*
  14. Session::config(array(
  15. 'cookie' => array('adapter' => 'Cookie'),
  16. 'default' => array('adapter' => 'Php')
  17. ));
  18. */
  19. /**
  20. * Uncomment the lines below to enable forms-based authentication. This configuration will attempt
  21. * to authenticate users against a `Users` model. In a controller, run
  22. * `Auth::check('default', $this->request)` to authenticate a user. This will check the POST data of
  23. * the request (`lithium\action\Request::$data`) to see if the fields match the `'fields'` key of
  24. * the configuration below. If successful, it will write the data returned from `Users::first()` to
  25. * the session using the default session configuration.
  26. *
  27. * Once the session data is written, you can call `Auth::check('default')` to check authentication
  28. * status or retrieve the user's data from the session. Call `Auth::clear('default')` to remove the
  29. * user's authentication details from the session. This effectively logs a user out of the system.
  30. * To modify the form input that the adapter accepts, or how the configured model is queried, or how
  31. * the data is stored in the session, see the `Form` adapter API or the `Auth` API, respectively.
  32. *
  33. * @see lithium\security\auth\adapter\Form
  34. * @see lithium\action\Request::$data
  35. * @see lithium\security\Auth
  36. */
  37. // use lithium\security\Auth;
  38. // Auth::config(array(
  39. // 'default' => array(
  40. // 'adapter' => 'Form',
  41. // 'model' => 'Users',
  42. // 'fields' => array('username', 'password')
  43. // )
  44. // ));
  45. ?>